Remove rescue block and add test for error bubbling in InputSchema validation

This commit is contained in:
Tyler Rowsell 2025-06-09 10:02:29 -04:00
commit 934a5e8db4
No known key found for this signature in database
GPG key ID: 0B7F267BCD08BF19

View file

@ -51,6 +51,16 @@ module MCP
schema.validate_arguments({ foo: 123 })
end
end
test "unexpected errors bubble up from validate_arguments" do
schema = InputSchema.new(properties: { foo: { type: "string" } }, required: [:foo])
JSON::Validator.stub(:fully_validate, ->(*) { raise "unexpected error" }) do
assert_raises(RuntimeError) do
schema.validate_arguments({ foo: "bar" })
end
end
end
end
end
end