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

Commit c4364ea

Browse files
committed
Adapt to hash formatting in Ruby 3.4 in the differ
1 parent 3b539d0 commit c4364ea

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

spec/rspec/support/differ_spec.rb

+4
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,8 @@ def inspect; "<BrokenObject>"; end
306306
|
307307
EOD
308308

309+
expected_diff.gsub!('=>',' => ') if RUBY_VERSION.to_f > 3.3
310+
309311
diff = differ.diff(expected,actual)
310312
expect(diff).to be_diffed_as(expected_diff)
311313
end
@@ -375,6 +377,7 @@ def inspect; "<BrokenObject>"; end
375377
|+"c" => {"key_1"=>#{formatted_time}},
376378
|
377379
EOD
380+
expected_diff.gsub!('"=>','" => ') if RUBY_VERSION.to_f > 3.3
378381

379382
left_side_hash = {'c' => {'key_1' => time}}
380383
right_side_hash = {'b' => {'key_1' => time}}
@@ -408,6 +411,7 @@ def inspect; "<BrokenObject>"; end
408411
|+[{"a"=>#{formatted_time}}, "c"]
409412
|
410413
EOD
414+
expected_diff.gsub!('=>',' => ') if RUBY_VERSION.to_f > 3.3
411415

412416
left_side_array = [{'a' => time}, 'c']
413417
right_side_array = [{'b' => time}, 'c']

0 commit comments

Comments
 (0)