spec/betterlog/global_metadata_spec.rb in betterlog-2.0.1 vs spec/betterlog/global_metadata_spec.rb in betterlog-2.0.2
- old
+ new
@@ -37,32 +37,25 @@
it 'can add to context and remove it' do
expect(Betterlog::GlobalMetadata.current).to be_empty
Betterlog::GlobalMetadata.with_meta(
'foo' => 'bar',
:bar => 'foo',
- ) do |my_context|
+ ) do
expect(Betterlog::GlobalMetadata.current).to eq(foo: 'bar', bar: 'foo')
- expect(my_context).to eq(foo: 'bar', bar: 'foo')
- expect(my_context).to be_frozen
end
expect(Betterlog::GlobalMetadata.current).to be_empty
end
it 'can add to nested context and remove it' do
expect(Betterlog::GlobalMetadata.current).to be_empty
Betterlog::GlobalMetadata.with_meta(
'foo' => 'bar',
:bar => 'foo',
- ) do |my_context|
+ ) do
expect(Betterlog::GlobalMetadata.current).to eq(foo: 'bar', bar: 'foo')
- expect(my_context).to eq(foo: 'bar', bar: 'foo')
- expect(my_context).to be_frozen
Betterlog::GlobalMetadata.with_meta('quux' => 'quark') do |my_context|
- expect(my_context).to be_frozen
expect(Betterlog::GlobalMetadata.current).to eq(foo: 'bar', bar: 'foo', quux: 'quark')
- expect(my_context).to eq(foo: 'bar', bar: 'foo', quux: 'quark')
end
- expect(my_context).to eq(foo: 'bar', bar: 'foo')
end
expect(Betterlog::GlobalMetadata.current).to be_empty
end
it 'has shortcut method Betterlog.with_meta' do