Skip to content

Instantly share code, notes, and snippets.

@danivovich
Created January 25, 2012 01:04
Show Gist options
  • Save danivovich/1673928 to your computer and use it in GitHub Desktop.
Save danivovich/1673928 to your computer and use it in GitHub Desktop.
Shallow copy issue with rspec metadata
describe 'outer', :one => { :two => 2 } do
context 'inner1' do
before do
example.metadata[:one][:three] = 3
end
it 'should have 3' do
example.metadata[:one][:three].should == 3
end
end
context 'inner2' do
it 'should not have 3' do
example.metadata[:one][:three].should be_nil # FAIL
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment