Skip to content

Instantly share code, notes, and snippets.

@keithrbennett
Created November 29, 2013 22:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save keithrbennett/7712890 to your computer and use it in GitHub Desktop.
Save keithrbennett/7712890 to your computer and use it in GitHub Desktop.
Illustrates that before_all applies only to the describe block in which it is defined.
describe 'a' do
before(:all) { puts 'a' }
it 'should be true' do
puts 'in test a'
end
end
describe 'b' do
before(:all) { puts 'b' }
it 'should be true' do
puts 'in test b'
end
end
# outputs:
# > before_all rspec a_spec.rb
# a
# in test a
# .b
# in test b
# .
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment