Sha256: 32a9483183cab0416a329fd3b7d613a05f4bb51bdd1566c31245b3e4f95acbff
Contents?: true
Size: 648 Bytes
Versions: 8
Compression:
Stored size: 648 Bytes
Contents
describe Middleware::IsolatedContextRegistry do let(:payload) { [200, {'Content-Type' => 'text/plain'}, ['OK']] } let(:app) { lambda { |env| env[2] = GlobalContextRegistry.get(:foo); env } } let(:middleware) { described_class.new(app) } describe '.call' do specify do GlobalContextRegistry.set(:foo, 'bar') # Assert that a new global registry is created and read from, where :foo is not set expect(middleware.call(payload)).to eq [200, {'Content-Type' => 'text/plain'}, nil] # Assert that the outer global context registry is restored expect(GlobalContextRegistry.get(:foo)).to eq 'bar' end end end
Version data entries
8 entries across 8 versions & 1 rubygems