[rspec-users] features and form filling - going declarative?
lists-rspec at shopwatch.org
Fri Nov 7 14:44:45 EST 2008
Joseph Wilk wrote:
> Ben Mabley has written a great article on imperative vs declarative
> steps  which is a great read.
+1! That article was a real eye-opener to me.
But I keep realizing that, if you keep following the temptation to
super-abstract your specs - from scenarios into matchers, and in other
places - you end up reinventing Ruby. Or AppleScript. Or sendmail.cf.
It's like the XML-heavy "configuration files" in Java that Rails tries so
hard to get away from; at some point, your code becomes a generic execution
environment for your config file, which is now really the code, which you
then refactor into meta-config files...
If you get too declarative, I think you make it impossible for end users to
write stories; they can write them, sure, but they'll all require new step
matchers, which will require actual coding.
I don't think it's actually a solvable problem - something, somewhere has to
know how to fill in the form. Either you do it in the scenario, where it
gets repeated a lot, or you refactor it into the matcher, which requires
enough programming ability to understand refactoring, abstraction, and
function calls in the first place.
More information about the rspec-users