[LRUG] Writing readable feature tests with RSpec
Paul Battley
pbattley at gmail.com
Sat Jul 26 04:30:06 PDT 2014
On 26 July 2014 01:24, Andrew Premdas <apremdas at gmail.com> wrote:
> This is really unfortunate. The fact that regex's are there in Cucumber
> means that you 'can' do all sorts of stupid things with them. If you do that
> will be a burden. However it doesn't mean you should do this or have to do
> this. 50% of my step definitions have no parameters at all, and I suspect
> less than 3% have more then one parameter.
All other considerations aside, I find that the use of string matching
for dispatch is an inconvenience when working with Cucumber. In my
editor[1], I can go straight to the definition of a method just by
pressing a key combo[2], which really helps in navigating unfamiliar
code. With Cucumber, I have to use a lucky guess or just grep for a
distinctive bit of the string.
Of course, *I* always put my own definitions in sensible places etc.
etc., but in reality most projects are collaborative and even though
all our collaborators are intelligent and well-meaning people, we
don't all think in exactly the same way.
Perhaps it's just a tooling problem - perhaps it's already been solved
and I'm just blissfully ignorant! - but I do think that Cucumber's
string matching presents a concrete difficulty, especially on larger
projects and teams, and I think that this problem exists regardless of
any overuse of parameters within regular expressions.
Paul.
1. Vim with ctags and Ctrl-].
2. Unless someone's taken the metaprogramming too far, of course.
More information about the Chat
mailing list