Merge pull request #237 from koic/replace_assert_empty_with_assert_equal_using_explicit_literals

Replace `assert_empty` with `assert_equal` using explicit literals
This commit is contained in:
Koichi ITO 2026-03-03 01:05:16 +09:00 • committed by GitHub
commit fa9f374d73
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 22 additions and 22 deletions

View file

@ -213,7 +213,7 @@ module MCP
# This test verifies the complete integration from server to transport
# Start with no output
assert_empty @mock_stdout.output
assert_equal([], @mock_stdout.output)
# Add a prompt and notify
@server.define_prompt(

View file

@ -45,7 +45,7 @@ module MCP
response = JSON.parse(output.string, symbolize_names: true)
assert_equal("2.0", response[:jsonrpc])
assert_equal("123", response[:id])
assert_empty(response[:result])
assert_equal({}, response[:result])
refute(@transport.instance_variable_get(:@open))
ensure
$stdin = original_stdin

View file

@ -46,7 +46,7 @@ module MCP
body = JSON.parse(response[2][0])
assert_equal "2.0", body["jsonrpc"]
assert_equal "123", body["id"]
assert_empty(body["result"])
assert_equal({}, body["result"])
end
test "handles POST request with invalid JSON" do
@ -362,7 +362,7 @@ module MCP
@transport.close
# Verify session was cleaned up
assert_empty @transport.instance_variable_get(:@sessions)
assert_equal({}, @transport.instance_variable_get(:@sessions))
end
test "sends notification to correct session with multiple active sessions" do
@ -1044,7 +1044,7 @@ module MCP
response = stateless_transport.handle_request(request)
assert_equal 202, response[0]
assert_empty(response[1])
assert_equal({}, response[1])
body = response[2][0]
assert_nil(body)
@ -1134,8 +1134,8 @@ module MCP
response = @transport.handle_request(notif_request)
assert_equal 202, response[0]
assert_empty(response[1])
assert_empty(response[2])
assert_equal({}, response[1])
assert_equal([], response[2])
end
test "handles POST request with body including JSON-RPC response object and returns with no body" do
@ -1160,8 +1160,8 @@ module MCP
response = @transport.handle_request(request)
assert_equal 202, response[0]
assert_empty(response[1])
assert_empty(response[2])
assert_equal({}, response[1])
assert_equal([], response[2])
end
private