Skip to content

Commit 0f31e1b

Browse files
Merge pull request #8100 from rubygems/deivid-rodriguez/port-ruby-core-changes
Adapt specs to ruby core changes in how hashes are printed (cherry picked from commit 5d3a097)
1 parent 76eb5dd commit 0f31e1b

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

bundler/spec/bundler/endpoint_specification_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
expect { subject }.to raise_error(
4343
Bundler::GemspecError,
4444
a_string_including("There was an error parsing the metadata for the gem foo (1.0.0)").
45-
and(a_string_including('The metadata was {"rubygems"=>">\n"}'))
45+
and(a_string_including("The metadata was #{{ "rubygems" => ">\n" }.inspect}"))
4646
)
4747
end
4848
end

bundler/spec/install/gems/compact_index_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@
173173
bundle :install, verbose: true, artifice: "compact_index_checksum_mismatch"
174174
expect(out).to include("Fetching gem metadata from #{source_uri}")
175175
expect(out).to include("The checksum of /versions does not match the checksum provided by the server!")
176-
expect(out).to include('Calculated checksums {"sha-256"=>"8KfZiM/fszVkqhP/m5s9lvE6M9xKu4I1bU4Izddp5Ms="} did not match expected {"sha-256"=>"ungWv48Bz+pBQUDeXa4iI7ADYaOWF3qctBD/YfIAFa0="}')
176+
expect(out).to include("Calculated checksums #{{ "sha-256" => "8KfZiM/fszVkqhP/m5s9lvE6M9xKu4I1bU4Izddp5Ms=" }.inspect} did not match expected #{{ "sha-256" => "ungWv48Bz+pBQUDeXa4iI7ADYaOWF3qctBD/YfIAFa0=" }.inspect}")
177177
expect(the_bundle).to include_gems "myrack 1.0.0"
178178
end
179179

test/rubygems/test_gem_dependency.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def test_initialize_type_bad
2222
Gem::Dependency.new "monkey" => "1.0"
2323
end
2424

25-
assert_equal 'dependency name must be a String, was {"monkey"=>"1.0"}',
25+
assert_equal "dependency name must be a String, was #{{ "monkey" => "1.0" }.inspect}",
2626
e.message
2727
end
2828

test/rubygems/test_require.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -721,11 +721,11 @@ def test_require_bundler
721721
_, err = capture_subprocess_io do
722722
system(*ruby_with_rubygems_in_load_path, "-w", "--disable=gems", "-C", dir, "main.rb")
723723
end
724-
assert_match(/{:x=>1}\n{:y=>2}\n$/, err)
724+
assert_match(/#{{ x: 1 }.inspect}\n#{{ y: 2 }.inspect}\n$/, err)
725725
_, err = capture_subprocess_io do
726726
system(*ruby_with_rubygems_in_load_path, "-w", "--enable=gems", "-C", dir, "main.rb")
727727
end
728-
assert_match(/{:x=>1}\n{:y=>2}\n$/, err)
728+
assert_match(/#{{ x: 1 }.inspect}\n#{{ y: 2 }.inspect}\n$/, err)
729729
end
730730
end
731731
end

0 commit comments

Comments
 (0)