Skip to content

Instantly share code, notes, and snippets.

@maltoe
Created May 28, 2013 12:08
Show Gist options
  • Save maltoe/5662305 to your computer and use it in GitHub Desktop.
Save maltoe/5662305 to your computer and use it in GitHub Desktop.
Shared context / global config before hooks called in wrong order
require_relative 'spec_helper'
describe 'A' do
describe 'B', :a => :b do
it 'succeeds' do
puts 'succeeds'
end
end
end
shared_context 'shared_context', :a => :b do
before(:all) do
@global_variable.should be
end
end
require 'rspec'
require_relative 'shared_context'
RSpec.configure do |config|
config.before(:all) do
@global_variable = 'string'
end
end
require_relative 'spec_helper'
describe 'A', :a => :b do
it 'fails' do
puts 'fails'
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment