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

Commit 7259d91

Browse files
committed
change Ruby 3.4 output matching
1 parent 7c4f5dd commit 7259d91

File tree

3 files changed

+7
-8
lines changed

3 files changed

+7
-8
lines changed

features/configuration/backtrace_exclusion_patterns.feature

+3-3
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ Feature: Excluding lines from the backtrace
119119
"""
120120
When I run `rspec --backtrace`
121121
Then the output should contain "1 example, 1 failure"
122-
And the output should contain "spec/support/custom_helper.rb:2:in `assert_baz'"
122+
And the output should contain %R{spec/support/custom_helper.rb:2:in ('Object#|`)assert_baz'}
123123
And the output should contain "lib/rspec/expectations"
124124
And the output should contain "lib/rspec/core"
125125
@@ -150,5 +150,5 @@ Feature: Excluding lines from the backtrace
150150
config.filter_gems_from_backtrace "my_gem"
151151
end
152152
"""
153-
Then the output from `rspec` should contain "vendor/my_gem-1.2.3/lib/my_gem.rb:4:in `do_amazing_things!'"
154-
But the output from `rspec --require spec_helper` should not contain "vendor/my_gem-1.2.3/lib/my_gem.rb:4:in `do_amazing_things!'"
153+
Then the output from `rspec` should contain %R{vendor/my_gem-1.2.3/lib/my_gem.rb:4:in (`|'MyGem\.)do_amazing_things!'}
154+
But the output from `rspec --require spec_helper` should not contain %R{vendor/my_gem-1.2.3/lib/my_gem.rb:4:in (`|'MyGem\.)do_amazing_things!'}

features/configuration/enable_global_dsl.feature

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ Feature: Global namespace DSL
5959
end
6060
"""
6161
When I run `rspec`
62-
Then the output should contain "undefined method `describe'"
62+
Then the output should contain %R{undefined method (`|')describe'}
6363

6464
Scenario: Regardless of setting
6565
Given a file named "spec/example_spec.rb" with:

features/configuration/zero_monkey_patching_mode.feature

+3-4
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,10 @@ Feature: Zero monkey patching mode
8080
end
8181
"""
8282
When I run `rspec spec/example_should_spec.rb`
83-
Then the output should contain all of these:
84-
| undefined method `should' |
85-
| unexpected message :stub |
83+
Then the output should contain %R{undefined method (`|')should'}
84+
And the output should contain "unexpected message :stub"
8685
When I run `rspec spec/example_describe_spec.rb`
87-
Then the output should contain "undefined method `describe'"
86+
Then the output should contain %R{undefined method (`|')describe'}
8887

8988
Scenario: `allow` and `expect` syntax works with monkey patching
9089
Given a file named "spec/spec_helper.rb" with:

0 commit comments

Comments
 (0)