> > I have mixed feelings about this. If you do build up a library of step > groups, having explicit scoping like this can be a great benefit. > Agreed it makes things less convenient otherwise.
Hi David Not sure I follow. Do you mean explicit scoping as having to type "steps_for(:login)."? If so, I guess that would be handy to call methods across step groups, but that would probably be bad style if they were in different files. I see these helper methods as just a factoring out of identical code. I can see copying the helper methods to the scope in which the steps > are executed. WDYT? Do you mean copy and paste? Or have the code track down the methods you created in the StepGroup scope and copy them into the runner scope? If so that would be cool, it would be transparent then. Name clashes could be an issue though. Syntax day-dreaming led me to think of something like this: Given "a signed-in support user called '$name'" do |name| @support_user = SupportUser.new # log in, etc end Given "something that needs a support user" do give_me "a signed-in support user called 'Fred'" @support_user.support_someone end or When "user signs in with '$username' and '$password'" do |username, password| # type form, click submit etc end Given "a signed-in support user called '$name'" do |name| perform_step "user signs in with 'support_user' and 'secret'" end or Then "user should see text '$text'" do |text| page.should =~ /text/ # type form, click submit etc end Then "user should see their details" do include_requirement "user should see text 'Adam'" include_requirement "user should see text 'Smith'" include_requirement "user should see text '[EMAIL PROTECTED]'" end Is anything like this currently possible? If not, would it be (a) a Good Thing and (b) straightforward to implement? Ashley
_______________________________________________ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users