Skip to content

Commit

Permalink
Update default gem test for colon-style hash inspect
Browse files Browse the repository at this point in the history
  • Loading branch information
tompng authored and mame committed Oct 3, 2024
1 parent cc9be42 commit e2bc890
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion spec/bundler/bundler/endpoint_specification_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
expect { subject }.to raise_error(
Bundler::GemspecError,
a_string_including("There was an error parsing the metadata for the gem foo (1.0.0)").
and(a_string_including('The metadata was {"rubygems"=>">\n"}'))
and(a_string_including("The metadata was #{{ "rubygems" => ">\n" }.inspect}"))
)
end
end
Expand Down
2 changes: 1 addition & 1 deletion spec/bundler/install/gems/compact_index_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@
bundle :install, verbose: true, artifice: "compact_index_checksum_mismatch"
expect(out).to include("Fetching gem metadata from #{source_uri}")
expect(out).to include("The checksum of /versions does not match the checksum provided by the server!")
expect(out).to include('Calculated checksums {"sha-256"=>"8KfZiM/fszVkqhP/m5s9lvE6M9xKu4I1bU4Izddp5Ms="} did not match expected {"sha-256"=>"ungWv48Bz+pBQUDeXa4iI7ADYaOWF3qctBD/YfIAFa0="}')
expect(out).to include("Calculated checksums #{{ "sha-256" => "8KfZiM/fszVkqhP/m5s9lvE6M9xKu4I1bU4Izddp5Ms=" }.inspect} did not match expected #{{ "sha-256" => "ungWv48Bz+pBQUDeXa4iI7ADYaOWF3qctBD/YfIAFa0=" }.inspect}")
expect(the_bundle).to include_gems "myrack 1.0.0"
end

Expand Down
2 changes: 1 addition & 1 deletion test/error_highlight/test_error_highlight.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1241,7 +1241,7 @@ def custom_formatter.message_for(spot)
assert_error_message(NoMethodError, <<~END) do
undefined method `time' for #{ ONE_RECV_MESSAGE }
{:first_lineno=>#{ __LINE__ + 3 }, :first_column=>7, :last_lineno=>#{ __LINE__ + 3 }, :last_column=>12, :snippet=>" 1.time {}\\n"}
#{{ first_lineno: __LINE__ + 3, first_column: 7, last_lineno: __LINE__ + 3, last_column: 12, snippet: " 1.time {}\n" }.inspect}
END

1.time {}
Expand Down
8 changes: 4 additions & 4 deletions test/rdoc/test_rdoc_ri_driver.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@ def test_self_dump
RDoc::RI::Driver.dump @store1.cache_path
end

assert_match %r%:class_methods%, out
assert_match %r%:modules%, out
assert_match %r%:instance_methods%, out
assert_match %r%:ancestors%, out
assert_match %r%:class_methods|class_methods:%, out
assert_match %r%:modules|modules:%, out
assert_match %r%:instance_methods|instance_methods:%, out
assert_match %r%:ancestors|ancestors:%, out
end

def test_add_also_in_empty
Expand Down
2 changes: 1 addition & 1 deletion test/rubygems/test_gem_dependency.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def test_initialize_type_bad
Gem::Dependency.new "monkey" => "1.0"
end

assert_equal 'dependency name must be a String, was {"monkey"=>"1.0"}',
assert_equal "dependency name must be a String, was #{{ "monkey" => "1.0" }.inspect}",
e.message
end

Expand Down
4 changes: 2 additions & 2 deletions test/rubygems/test_require.rb
Original file line number Diff line number Diff line change
Expand Up @@ -721,11 +721,11 @@ def test_require_bundler
_, err = capture_subprocess_io do
system(*ruby_with_rubygems_in_load_path, "-w", "--disable=gems", "-C", dir, "main.rb")
end
assert_match(/{:x=>1}\n{:y=>2}\n$/, err)
assert_match(/#{{ x: 1 }.inspect}\n#{{ y: 2 }.inspect}\n$/, err)
_, err = capture_subprocess_io do
system(*ruby_with_rubygems_in_load_path, "-w", "--enable=gems", "-C", dir, "main.rb")
end
assert_match(/{:x=>1}\n{:y=>2}\n$/, err)
assert_match(/#{{ x: 1 }.inspect}\n#{{ y: 2 }.inspect}\n$/, err)
end
end
end
Expand Down

0 comments on commit e2bc890

Please sign in to comment.