Skip to content

Commit 386ad8b

Browse files
hsbtmatzbot
authored andcommitted
[ruby/rubygems] Skip test when Psych unsafe_load is used
ruby/rubygems@2636b4d24a
1 parent 83571ba commit 386ad8b

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

test/rubygems/test_gem_commands_owner_command.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,11 @@ def test_show_owners
5555
end
5656

5757
def test_show_owners_dont_load_objects
58-
pend "testing a psych-only API" unless defined?(::Psych::DisallowedClass)
58+
Gem.load_yaml
59+
60+
# Gem::SafeYAML.load uses Psych.unsafe_load when Psych is enabled,
61+
# which does not restrict classes. Only YAMLSerializer restricts object tags.
62+
pend "Gem::SafeYAML.load uses Psych.unsafe_load which does not restrict classes" if Gem.use_psych?
5963

6064
response = <<EOF
6165
---

0 commit comments

Comments
 (0)