Hmm, all of a sudden this thread is spiraling away from my original question :). Which is good of course :). I've made some inline comments.
On 17-mrt-2008, at 13:12, David Chelimsky wrote: > On Mon, Mar 17, 2008 at 7:05 AM, Ashley Moran > <[EMAIL PROTECTED]> wrote: >> On 13/03/2008, Bart Zonneveld <[EMAIL PROTECTED]> wrote: >> >>> Hey list, >>> >>> I'm refactoring some much-used functionality into a common_steps >>> step >>> group. Methods like this are in there: >> >> >> Hi Bart / list >> >> This is not quite what you are thinking but I've noticed something >> strange >> about steps_for. Basically when the steps are define the Given, >> When, Then >> methods run in the context of a StepGroup, but when they run they >> have a >> different context. >> >> So to call a method in a step group you have to do something like >> this: >> >> steps_for :login do >> def sign_in(page, username, password) >> # ... >> end >> >> Given "a signed-in support user" do >> # ... >> @page = browser.open_page("/signin") >> steps_for(:login).sign_in(@page, "[EMAIL PROTECTED]", >> "support-password") >> end I can see how this would work for you, but I actually want something more abstracted. You're specifing the sign_in method inside the same stepgroup, but I want to reference it from another stepgroup. So, to follow your example, I want to call sign_in(page, username, password) from my common_steps stepgroup. regards, bartz _______________________________________________ rspec-users mailing list rspec-users@rubyforge.org http://rubyforge.org/mailman/listinfo/rspec-users