First of all I don't think doing validation tests in cucumber like this makes any sense at all. Whilst it may have been useful to put these values in a table to coax some idea of what they should be. Why do they have to remain in the feature once it has been implemented. I'm sure if you showed the whole feature it would give no indication why min value for Treatment Duration should be 2. Why not 27 or 'wibble'. Once you implement this feature you end up with something that is:
- a horrendous violation of DRY
- a really poor piece of documentation
- something that will break if anyone changes the rules about what these minimums and maximums are
- something that is really expensive to run for what it tests ( you can do this sort of thing much faster and cheaper in unit tests)
Finally I suspect once its implemented the only people who will read it will be the developers, and it will just make their lives more difficult.
So instead:
1. Put the values in the code as constants in a module
2. Document the module so it explains why the values are as they are. I'm sure your features does nothing to explain why the minimum treatment duration is 2. 2 what's by the way (days, weeks, visits, semesters ....
3. Generate your documentation as part of your automation process so your business users can see the 'specific information'
3. Write unit tests to show that the validation uses the constants
4. Save the expensive time of feature execution for something more useful
Apologies for the polemic, but hopefully you can find something useful in it.
All best
Andrew
--
-- Rules --
1) Please prefix the subject with [Ruby], [JVM] or [JS].
2) Please use interleaved answers http://en.wikipedia.org/wiki/Posting_style#Interleaved_style
3) If you have a question, don't reply to an existing message. Start a new topic instead.
You received this message because you are subscribed to the Google Groups Cukes group. To post to this group, send email to cu...@googlegroups.com. To unsubscribe from this group, send email to cukes+un...@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/cukes?hl=en