Created
May 6, 2011 08:06
-
-
Save mariovisic/958592 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'spec_helper' | |
| describe CheckoutsController do | |
| before :all do | |
| puts 'running' | |
| @counter ||= 0 | |
| @counter += 1 | |
| end | |
| context 'creating a context' do | |
| context 'within a context' do | |
| context 'inside a context' do | |
| it 'should not run the before all again' do | |
| @counter.should == 1 # Passes rspec 2.5.1 | |
| end | |
| end | |
| end | |
| end | |
| context 'creating another context that is not nested' do | |
| context 'also' do | |
| it 'should not increase the counter' do | |
| @counter.should == 1 # Passes rspec 2.5.1 | |
| end | |
| end | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment