@@ -58,9 +58,9 @@ class StreamableHTTPNotificationIntegrationTest < ActiveSupport::TestCase
58
58
io . rewind
59
59
output = io . read
60
60
61
- assert_includes output , "data: #{ Methods ::NOTIFICATIONS_TOOLS_LIST_CHANGED } "
62
- assert_includes output , "data: #{ Methods ::NOTIFICATIONS_PROMPTS_LIST_CHANGED } "
63
- assert_includes output , "data: #{ Methods ::NOTIFICATIONS_RESOURCES_LIST_CHANGED } "
61
+ assert_includes output , "data: { \" jsonrpc \" : \" 2.0 \" , \" method \" : \" #{ Methods ::NOTIFICATIONS_TOOLS_LIST_CHANGED } \" }"
62
+ assert_includes output , "data: { \" jsonrpc \" : \" 2.0 \" , \" method \" : \" #{ Methods ::NOTIFICATIONS_PROMPTS_LIST_CHANGED } \" }"
63
+ assert_includes output , "data: { \" jsonrpc \" : \" 2.0 \" , \" method \" : \" #{ Methods ::NOTIFICATIONS_RESOURCES_LIST_CHANGED } \" }"
64
64
end
65
65
66
66
test "notifications are broadcast to all connected sessions" do
@@ -111,11 +111,11 @@ class StreamableHTTPNotificationIntegrationTest < ActiveSupport::TestCase
111
111
# Check both sessions received the notification
112
112
io1 . rewind
113
113
output1 = io1 . read
114
- assert_includes output1 , "data: #{ Methods ::NOTIFICATIONS_TOOLS_LIST_CHANGED } "
114
+ assert_includes output1 , "data: { \" jsonrpc \" : \" 2.0 \" , \" method \" : \" #{ Methods ::NOTIFICATIONS_TOOLS_LIST_CHANGED } \" }"
115
115
116
116
io2 . rewind
117
117
output2 = io2 . read
118
- assert_includes output2 , "data: #{ Methods ::NOTIFICATIONS_TOOLS_LIST_CHANGED } "
118
+ assert_includes output2 , "data: { \" jsonrpc \" : \" 2.0 \" , \" method \" : \" #{ Methods ::NOTIFICATIONS_TOOLS_LIST_CHANGED } \" }"
119
119
end
120
120
121
121
test "server continues to work when SSE connection is closed" do
@@ -191,7 +191,7 @@ class StreamableHTTPNotificationIntegrationTest < ActiveSupport::TestCase
191
191
# Check the notification was received
192
192
io . rewind
193
193
output = io . read
194
- assert_includes output , "data: #{ Methods ::NOTIFICATIONS_TOOLS_LIST_CHANGED } "
194
+ assert_includes output , "data: { \" jsonrpc \" : \" 2.0 \" , \" method \" : \" #{ Methods ::NOTIFICATIONS_TOOLS_LIST_CHANGED } \" }"
195
195
196
196
# Verify the tool was added to the server
197
197
assert @server . tools . key? ( "dynamic_tool" )
@@ -229,7 +229,7 @@ class StreamableHTTPNotificationIntegrationTest < ActiveSupport::TestCase
229
229
output = io . read
230
230
231
231
# SSE format should be "data: <message>\n\n"
232
- assert_match ( /data: #{ Regexp . escape ( Methods ::NOTIFICATIONS_TOOLS_LIST_CHANGED ) } \n / , output )
232
+ assert_match ( /data: \{ "jsonrpc":"2 \. 0","method":" #{ Regexp . escape ( Methods ::NOTIFICATIONS_TOOLS_LIST_CHANGED ) } " \ }\n / , output )
233
233
end
234
234
235
235
private
0 commit comments