Skip to content

Instantly share code, notes, and snippets.

@mariovisic
Created May 6, 2011 08:06
Show Gist options
  • Select an option

  • Save mariovisic/958592 to your computer and use it in GitHub Desktop.

Select an option

Save mariovisic/958592 to your computer and use it in GitHub Desktop.
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