Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Multiple before(:each)?
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
David Kahn  
View profile   Translate to Translated (View Original)
 More options Feb 17 2011, 12:51 pm
From: David Kahn <d...@structuralartistry.com>
Date: Thu, 17 Feb 2011 11:51:08 -0600
Local: Thurs, Feb 17 2011 12:51 pm
Subject: Multiple before(:each)?

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


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Luismi Cavallé  
View profile  
 More options Feb 18 2011, 6:41 am
From: Luismi Cavallé <lmcava...@gmail.com>
Date: Fri, 18 Feb 2011 12:41:24 +0100
Local: Fri, Feb 18 2011 6:41 am
Subject: Re: [steakrb] Multiple before(:each)?
Hi David:

The answer is there, waiting for you. You just need to run your own example :P

-- Luismi

On Feb 17, 2011, at 6:51 PM, David Kahn wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
David Kahn  
View profile   Translate to Translated (View Original)
 More options Feb 18 2011, 10:01 am
From: David Kahn <d...@structuralartistry.com>
Date: Fri, 18 Feb 2011 09:01:10 -0600
Local: Fri, Feb 18 2011 10:01 am
Subject: Re: [steakrb] Multiple before(:each)?

Yeah, sorry, was being very lazy.... and the answer is yes! :)


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »