Skip to content

Instantly share code, notes, and snippets.

@godfat
Last active July 14, 2016 07:38
Show Gist options
  • Save godfat/36246f9ae9afb304a1c4c9c157e9b633 to your computer and use it in GitHub Desktop.
Save godfat/36246f9ae9afb304a1c4c9c157e9b633 to your computer and use it in GitHub Desktop.
shared_context 'C0' do
let(:c0) { 0 }
end
shared_context 'C1' do
let(:c1) { 1 }
end
describe 'D0' do
include_context 'C0'
describe 'D1' do
include_context 'C1'
it 'can access c1' do
expect(c1).to eq(1)
end
it 'cannot access c0' do
expect(c0).to eq(0) # cannot find c0
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment