Created
July 13, 2015 12:27
-
-
Save chrp/af0a713f353dbae1c326 to your computer and use it in GitHub Desktop.
tiny demo to show when each callback kicks in around a rspec test
This file contains 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
describe 'describe 1' do | |
before(:all) do | |
puts '1: before all' | |
end | |
before(:each) do | |
puts '1: before each' | |
end | |
after(:each) do | |
puts '1: after each' | |
end | |
after(:all) do | |
puts '1: after all' | |
end | |
it 'test1 ' do | |
puts '1: test 1' | |
end | |
it 'test2 ' do | |
puts '1: test 2' | |
end | |
context 'describe 2' do | |
before(:all) do | |
puts ' 2: before all' | |
end | |
before(:each) do | |
puts ' 2: before each' | |
end | |
after(:each) do | |
puts ' 2: after each' | |
end | |
after(:all) do | |
puts ' 2: after all' | |
end | |
it 'test1 ' do | |
puts ' 2: test 1' | |
end | |
it 'test2 ' do | |
puts ' 2: test 2' | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment