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

Commit 9474cc0

Browse files
committed
fixup! Add an expected warning alias
1 parent 9ba0ca7 commit 9474cc0

File tree

4 files changed

+8
-4
lines changed

4 files changed

+8
-4
lines changed

spec/rspec/core/example_group_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,12 @@ def metadata_hash(*args)
5656
end
5757

5858
it 'does not treat the first argument as a metadata key even if it is a symbol' do
59-
group = with_isolated_stderr { RSpec.describe(:symbol) }
59+
group = with_an_expected_warning { RSpec.describe(:symbol) }
6060
expect(group.metadata).not_to include(:symbol)
6161
end
6262

6363
it 'treats the first argument as part of the description when it is a symbol' do
64-
group = with_isolated_stderr { RSpec.describe(:symbol) }
64+
group = with_an_expected_warning { RSpec.describe(:symbol) }
6565
expect(group.description).to eq("symbol")
6666
end
6767

spec/rspec/core/memoized_helpers_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ module RSpec::Core
55
before(:each) { RSpec.configuration.configure_expectation_framework }
66

77
def subject_value_for(describe_arg, &block)
8-
example_group = with_isolated_stderr { RSpec.describe(describe_arg, &block) }
8+
example_group = with_an_expected_warning { RSpec.describe(describe_arg, &block) }
99
subject_value = nil
1010
example_group.example { subject_value = subject }
1111
example_group.run

spec/rspec/core/metadata_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,7 @@ def metadata_for(*args)
387387

388388
context "with a Symbol" do
389389
it "returns the symbol" do
390-
expect(with_isolated_stderr { value_for(:group) }).to be(:group)
390+
expect(with_an_expected_warning { value_for(:group) }).to be(:group)
391391
end
392392
end
393393

spec/spec_helper.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,10 @@ def handle_current_dir_change
6262
ensure
6363
RSpec::Core::Metadata.instance_variable_set(:@relative_path_regex, nil)
6464
end
65+
66+
def with_an_expected_warning
67+
with_isolated_stderr { yield }
68+
end
6569
end
6670

6771
RSpec.configure do |c|

0 commit comments

Comments
 (0)