[ruby/psych] Remove excessive check of message

The order of "unexpected" and "missing" keyword argument errors at
`Data#initialize` had not been defined strictly.

[Bug #21844](https://bugs.ruby-lang.org/issues/21844)
ruby/ruby#15910

https://github.com/ruby/psych/commit/ba748d9b04
This commit is contained in:
Nobuyoshi Nakada 2026-01-20 23:00:08 +09:00 committed by git
parent 2842e61c92
commit c27ae8d91a

View File

@ -83,12 +83,11 @@ module Psych
# completely different members
TestData.send :remove_const, :D
TestData.const_set :D, Data.define(:foo, :bar)
TestData.const_set :D, Data.define(:a, :c)
e = assert_raise(ArgumentError) { Psych.unsafe_load d }
assert_equal 'unknown keywords: :a, :b', e.message
assert_include e.message, 'keyword:'
ensure
TestData.send :remove_const, :D
end
end
end