Skip to content

Commit e546d76

Browse files
committed
Rubocop
1 parent 55b03fc commit e546d76

File tree

3 files changed

+16
-16
lines changed

3 files changed

+16
-16
lines changed

test/mcp/server/transports/stdio_notification_integration_test.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def gets
3030
nil # Simulate end of input
3131
end
3232

33-
def set_encoding(encoding)
33+
def set_encoding(encoding) # rubocop:disable Naming/AccessorMethodName
3434
# Mock implementation
3535
end
3636

@@ -131,7 +131,7 @@ def closed?
131131
@server.define_tool(
132132
name: "dynamic_tool",
133133
description: "A dynamically added tool",
134-
) do |**args|
134+
) do |**_args|
135135
{ result: "success" }
136136
end
137137

@@ -213,7 +213,7 @@ def puts(message)
213213
@server.define_prompt(
214214
name: "test_prompt",
215215
description: "Test prompt",
216-
) do |args, server_context:|
216+
) do |_args, _server_context:|
217217
MCP::PromptResponse.new(messages: [{ role: "user", content: "Test" }])
218218
end
219219

test/mcp/server/transports/streamable_http_notification_integration_test.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ class StreamableHTTPNotificationIntegrationTest < ActiveSupport::TestCase
181181
@server.define_tool(
182182
name: "dynamic_tool",
183183
description: "A dynamically added tool",
184-
) do |**args|
184+
) do |**_args|
185185
{ result: "success" }
186186
end
187187

test/mcp/server_notification_test.rb

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,13 @@ def handle_request(request); end
2929
setup do
3030
configuration = MCP::Configuration.new
3131
configuration.instrumentation_callback = instrumentation_helper.callback
32-
32+
3333
@server = Server.new(
3434
name: "test_server",
3535
version: "1.0.0",
36-
configuration: configuration
36+
configuration: configuration,
3737
)
38-
38+
3939
@mock_transport = MockTransport.new(@server)
4040
@server.transport = @mock_transport
4141
end
@@ -69,7 +69,7 @@ def handle_request(request); end
6969

7070
test "notification methods work without transport" do
7171
server_without_transport = Server.new(name: "test_server")
72-
72+
7373
# Should not raise any errors
7474
assert_nothing_raised do
7575
server_without_transport.notify_tools_list_changed
@@ -85,16 +85,16 @@ def send_notification(method, params = nil)
8585
raise StandardError, "Transport error"
8686
end
8787
end.new(@server)
88-
88+
8989
@server.transport = error_transport
90-
90+
9191
# Mock the exception reporter
9292
expected_contexts = [
9393
{ notification: "tools_list_changed" },
9494
{ notification: "prompts_list_changed" },
95-
{ notification: "resources_list_changed" }
95+
{ notification: "resources_list_changed" },
9696
]
97-
97+
9898
call_count = 0
9999
@server.configuration.exception_reporter.expects(:call).times(3).with do |exception, context|
100100
assert_kind_of StandardError, exception
@@ -103,14 +103,14 @@ def send_notification(method, params = nil)
103103
call_count += 1
104104
true
105105
end
106-
106+
107107
# Should not raise errors to the caller
108108
assert_nothing_raised do
109109
@server.notify_tools_list_changed
110110
@server.notify_prompts_list_changed
111111
@server.notify_resources_list_changed
112112
end
113-
113+
114114
assert_equal 3, call_count
115115
end
116116

@@ -120,7 +120,7 @@ def send_notification(method, params = nil)
120120
@server.notify_resources_list_changed
121121

122122
assert_equal 3, @mock_transport.notifications.size
123-
123+
124124
notifications = @mock_transport.notifications
125125
assert_equal Methods::NOTIFICATIONS_TOOLS_LIST_CHANGED, notifications[0][:method]
126126
assert_equal Methods::NOTIFICATIONS_PROMPTS_LIST_CHANGED, notifications[1][:method]
@@ -133,4 +133,4 @@ def send_notification(method, params = nil)
133133
assert_equal "notifications/resources/list_changed", Methods::NOTIFICATIONS_RESOURCES_LIST_CHANGED
134134
end
135135
end
136-
end
136+
end

0 commit comments

Comments
 (0)