@@ -58,9 +58,9 @@ class StreamableHTTPNotificationIntegrationTest < ActiveSupport::TestCase
5858 io . rewind
5959 output = io . read
6060
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 } \" }"
6464 end
6565
6666 test "notifications are broadcast to all connected sessions" do
@@ -111,11 +111,11 @@ class StreamableHTTPNotificationIntegrationTest < ActiveSupport::TestCase
111111 # Check both sessions received the notification
112112 io1 . rewind
113113 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 } \" }"
115115
116116 io2 . rewind
117117 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 } \" }"
119119 end
120120
121121 test "server continues to work when SSE connection is closed" do
@@ -191,7 +191,7 @@ class StreamableHTTPNotificationIntegrationTest < ActiveSupport::TestCase
191191 # Check the notification was received
192192 io . rewind
193193 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 } \" }"
195195
196196 # Verify the tool was added to the server
197197 assert @server . tools . key? ( "dynamic_tool" )
@@ -229,7 +229,7 @@ class StreamableHTTPNotificationIntegrationTest < ActiveSupport::TestCase
229229 output = io . read
230230
231231 # 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 )
233233 end
234234
235235 private
0 commit comments