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

Commit

Permalink
Adapt to hash formatting in Ruby 3.4 in the differ
Browse files Browse the repository at this point in the history
  • Loading branch information
JonRowe committed Oct 19, 2024
1 parent 3b539d0 commit c4364ea
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions spec/rspec/support/differ_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,8 @@ def inspect; "<BrokenObject>"; end
|
EOD

expected_diff.gsub!('=>',' => ') if RUBY_VERSION.to_f > 3.3

diff = differ.diff(expected,actual)
expect(diff).to be_diffed_as(expected_diff)
end
Expand Down Expand Up @@ -375,6 +377,7 @@ def inspect; "<BrokenObject>"; end
|+"c" => {"key_1"=>#{formatted_time}},
|
EOD
expected_diff.gsub!('"=>','" => ') if RUBY_VERSION.to_f > 3.3

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

left_side_array = [{'a' => time}, 'c']
right_side_array = [{'b' => time}, 'c']
Expand Down

0 comments on commit c4364ea

Please sign in to comment.