Groups
Sign in
Groups
Steak
Conversations
About
Send feedback
Help
Multiple before(:each)?
16 views
Skip to first unread message
David Kahn
unread,
Feb 17, 2011, 12:51:08 PM
2/17/11
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to ste...@googlegroups.com
I am wondering if multiple contexts and before(:each) can be nested, and the first before(:each) still runs on the nested scenario:
context "one" do
before(:each) do
@something = 1
end
scenario "should x" do
...
end
context "two" do
before(:each) do
@something_else = 3
end
scenario "something plus something else should be four" do
(@something + @something_else).should == 4
end
end
end
Luismi Cavallé
unread,
Feb 18, 2011, 6:41:24 AM
2/18/11
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to ste...@googlegroups.com
Hi David:
The answer is there, waiting for you. You just need to run your own example :P
-- Luismi
David Kahn
unread,
Feb 18, 2011, 10:01:10 AM
2/18/11
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to ste...@googlegroups.com
Yeah, sorry, was being very lazy.... and the answer is yes! :)
Reply all
Reply to author
Forward
0 new messages