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

Commit a05496b

Browse files
committed
Use shared example group like it looks like it was intended.
This shared group was only included at one place in this file but it looks like there were two intended inclusions. This fixes that.
1 parent 31c1849 commit a05496b

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

spec/rspec/core/formatters/profile_formatter_spec.rb

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,6 @@ def profile *groups
3131
it "prints the percentage taken from the total runtime" do
3232
expect(formatter_output.string).to match(/, 100.0% of total time\):/)
3333
end
34-
35-
it "doesn't profile a single example group" do
36-
expect(formatter_output.string).not_to match(/slowest example groups/)
37-
end
3834
end
3935

4036
context "with one example group" do
@@ -51,6 +47,10 @@ def profile *groups
5147
end
5248

5349
it_should_behave_like "profiles examples"
50+
51+
it "doesn't profile a single example group" do
52+
expect(formatter_output.string).not_to match(/slowest example groups/)
53+
end
5454
end
5555

5656
context "with multiple example groups" do
@@ -62,7 +62,7 @@ def profile *groups
6262
# make it look slow without actually taking up precious time
6363
example.clock = example_clock
6464
end
65-
example_line_number = __LINE__ - 4
65+
example_line_number = __LINE__ - 4
6666
end
6767
group2 = RSpec.describe("fast group") do
6868
example("example 1") { }
@@ -71,6 +71,8 @@ def profile *groups
7171
profile group1, group2
7272
end
7373

74+
it_should_behave_like "profiles examples"
75+
7476
it "prints the slowest example groups" do
7577
expect(formatter_output.string).to match(/slowest example groups/)
7678
end

0 commit comments

Comments
 (0)