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

Commit 73ff597

Browse files
committed
Adjust matching arguments feature to cater for Rbuy 3.4 hash syntax differences
1 parent 99d420e commit 73ff597

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

features/setting_constraints/matching_arguments.feature

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ Feature: Matching arguments
7373
end
7474
"""
7575
When I run `rspec keyword_example_spec.rb`
76-
Then it should fail with the following output:
76+
Then it should fail with the following output, ignoring hash syntax:
7777
| 2 examples, 1 failure |
7878
| |
7979
| Failure/Error: dbl.foo(bar: "incorrect") |
@@ -100,7 +100,7 @@ Feature: Matching arguments
100100
end
101101
"""
102102
When I run `rspec keyword_example_spec.rb`
103-
Then it should fail with the following output:
103+
Then it should fail with the following output, ignoring hash syntax:
104104
| 1 example, 1 failure |
105105
| |
106106
| Failure/Error: dbl.foo({bar: "also incorrect"}) |
@@ -156,7 +156,7 @@ Feature: Matching arguments
156156
end
157157
"""
158158
When I run `rspec rspec_satisfy_spec.rb`
159-
Then it should fail with the following output:
159+
Then it should fail with the following output, ignoring hash syntax:
160160
| 2 examples, 1 failure |
161161
| |
162162
| Failure/Error: dbl.foo({ :a => { :b => { :c => 3 } } }) |

features/step_definitions/additional_cli_steps.rb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,13 @@
2222
diffable
2323
end
2424

25-
Then /^it should fail with the following output:$/ do |table|
25+
Then /^it should fail with the following output(, ignoring hash syntax)?:$/ do |ignore_hash_syntax, table|
2626
step %q(the exit status should be 1)
2727
lines = table.raw.flatten.reject(&:empty?)
28+
29+
if ignore_hash_syntax && RUBY_VERSION.to_f > 3.3
30+
lines = lines.map { |line| line.gsub(/([^\s])=>/, '\1 => ') }
31+
end
32+
2833
expect(all_output).to match_table(lines)
2934
end

0 commit comments

Comments
 (0)