Skip to content

Commit 479de00

Browse files
committed
add spec to raise coverage on deprecation buffer
1 parent 4b83890 commit 479de00

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

spec/rspec/core/configuration_spec.rb

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1471,6 +1471,16 @@ def metadata_hash(*args)
14711471
expect(config.formatters).to be_empty
14721472
end
14731473

1474+
it 'buffers deprecations until the reporter is ready' do
1475+
allow(config.formatter_loader).to receive(:prepare_default).and_wrap_original do |original, *args|
1476+
config.reporter.deprecation :message => 'Test deprecation'
1477+
original.call(*args)
1478+
end
1479+
expect {
1480+
config.reporter.notify :deprecation_summary, Notifications::NullNotification
1481+
}.to change { config.deprecation_stream.string }.to include 'Test deprecation'
1482+
end
1483+
14741484
it 'allows registering listeners without doubling up formatters' do
14751485
config.reporter.register_listener double(:message => nil), :message
14761486

0 commit comments

Comments
 (0)