Fix Ruby warnings in the GraphQL::Schema::InputObject class tests#5623
Conversation
|
I agree it'd be good to address this warning, but this change actually changes the semantics of the test. The intention of the test is to confirm that InputObject pattern matching is implemented correctly, and it doesn't match as if it had keys which it doesn't have. The object in this test doesn't have a By modifying the I realize this is splitting hairs but I don't think that reducing the scope of an existing test is the right way to address this warning. One way to keep the existing test but address the warning would be to use in { z: }
raise "Unexpectedly matched a non-present key, z: #{z.inspect} (in: #{input_object.inspect})"That would cause the test to fail if (I would have left it as a code suggestion but I couldn't figure out how to suggest a change to the unmodified line of the test 😖) |
|
Hmm, that’s an interesting approach - applied |
|
Thanks for this improvement! |
I ran tests for the
GraphQL::Schema::InputObjectclass with Ruby warnings enabled:Tests passed though 🟢 .