diff --git a/test/rubygems/test_gem_config_file.rb b/test/rubygems/test_gem_config_file.rb index ad120d2aaa..ae6739db98 100644 --- a/test/rubygems/test_gem_config_file.rb +++ b/test/rubygems/test_gem_config_file.rb @@ -548,4 +548,14 @@ if you believe they were disclosed to a third party. assert_equal("---\n:foo: \"bar\"\n", actual) end + + def test_handle_comment + yaml = <<~YAML + --- + :foo: bar # buzz + YAML + + actual = Gem::ConfigFile.load_with_rubygems_config_hash(yaml) + assert_equal("bar", actual[:foo]) + end end