This repository was archived by the owner on Nov 30, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +8
-4
lines changed Expand file tree Collapse file tree 4 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -56,12 +56,12 @@ def metadata_hash(*args)
56
56
end
57
57
58
58
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 ) }
60
60
expect ( group . metadata ) . not_to include ( :symbol )
61
61
end
62
62
63
63
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 ) }
65
65
expect ( group . description ) . to eq ( "symbol" )
66
66
end
67
67
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ module RSpec::Core
5
5
before ( :each ) { RSpec . configuration . configure_expectation_framework }
6
6
7
7
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 ) }
9
9
subject_value = nil
10
10
example_group . example { subject_value = subject }
11
11
example_group . run
Original file line number Diff line number Diff line change @@ -387,7 +387,7 @@ def metadata_for(*args)
387
387
388
388
context "with a Symbol" do
389
389
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 )
391
391
end
392
392
end
393
393
Original file line number Diff line number Diff line change @@ -62,6 +62,10 @@ def handle_current_dir_change
62
62
ensure
63
63
RSpec ::Core ::Metadata . instance_variable_set ( :@relative_path_regex , nil )
64
64
end
65
+
66
+ def with_an_expected_warning
67
+ with_isolated_stderr { yield }
68
+ end
65
69
end
66
70
67
71
RSpec . configure do |c |
You can’t perform that action at this time.
0 commit comments