Skip to content
This repository was archived by the owner on Nov 30, 2024. It is now read-only.

Commit 2a25e25

Browse files
committed
Merge pull request #1365 from rspec/reorder-deprecation-summary
Reorder deprecation_summary to come before dump_summary
2 parents a7c1d35 + 8fb63bb commit 2a25e25

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

lib/rspec/core/reporter.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,8 @@ def finish
9696
notify :start_dump, Notifications::NullNotification
9797
notify :dump_pending, Notifications::NullNotification
9898
notify :dump_failures, Notifications::NullNotification
99-
notify :dump_summary, Notifications::SummaryNotification.new(@duration, @example_count, @failure_count, @pending_count)
10099
notify :deprecation_summary, Notifications::NullNotification
100+
notify :dump_summary, Notifications::SummaryNotification.new(@duration, @example_count, @failure_count, @pending_count)
101101
notify :seed, Notifications::SeedNotification.new(@configuration.seed, seed_used?)
102102
ensure
103103
notify :close, Notifications::NullNotification

spec/rspec/core/reporter_spec.rb

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,16 @@ module RSpec::Core
2020
expect { reporter.finish }.to_not raise_error
2121
end
2222
end
23+
24+
it "dumps the failure summary after the deprecation summary so failures don't scroll off the screen and get missed" do
25+
formatter = instance_double("RSpec::Core::Formatter::ProgressFormatter")
26+
reporter.register_listener(formatter, :dump_summary, :deprecation_summary)
27+
28+
expect(formatter).to receive(:deprecation_summary).ordered
29+
expect(formatter).to receive(:dump_summary).ordered
30+
31+
reporter.finish
32+
end
2333
end
2434

2535
context "given one formatter" do

0 commit comments

Comments
 (0)