@@ -70,7 +70,7 @@ defmodule TestServerTest do
7070 TestServer . stop ( )
7171 end
7272
73- assert_raise RuntimeError , ~r/ The TestServer.Instance \# PID\< [0-9.]+\> is not running/ , fn ->
73+ assert_raise RuntimeError , ~r/ TestServer.Instance \# PID\< [0-9.]+\> is not running/ , fn ->
7474 { :ok , instance } = TestServer . start ( )
7575
7676 assert :ok = TestServer . stop ( )
@@ -131,7 +131,7 @@ defmodule TestServerTest do
131131 TestServer . url ( )
132132 end
133133
134- assert_raise RuntimeError , ~r/ The TestServer.Instance \# PID\< [0-9.]+\> is not running/ , fn ->
134+ assert_raise RuntimeError , ~r/ TestServer.Instance \# PID\< [0-9.]+\> is not running/ , fn ->
135135 { :ok , instance } = TestServer . start ( )
136136
137137 assert :ok = TestServer . stop ( )
@@ -172,7 +172,7 @@ defmodule TestServerTest do
172172
173173 describe "add/3" do
174174 test "when instance not running" do
175- assert_raise RuntimeError , ~r/ The TestServer.Instance \# PID\< [0-9.]+\> is not running/ , fn ->
175+ assert_raise RuntimeError , ~r/ TestServer.Instance \# PID\< [0-9.]+\> is not running/ , fn ->
176176 { :ok , instance } = TestServer . start ( )
177177
178178 assert :ok = TestServer . stop ( )
@@ -217,7 +217,7 @@ defmodule TestServerTest do
217217 end
218218 end
219219
220- assert capture_io ( fn -> ExUnit . run ( ) end ) =~ "Unexpected GET request received at /path."
220+ assert capture_io ( fn -> ExUnit . run ( ) end ) =~ "received an unexpected GET request at /path."
221221 end
222222
223223 test "with mismatching method" do
@@ -232,7 +232,7 @@ defmodule TestServerTest do
232232 end
233233 end
234234
235- assert capture_io ( fn -> ExUnit . run ( ) end ) =~ "Unexpected GET request received at /."
235+ assert capture_io ( fn -> ExUnit . run ( ) end ) =~ "received an unexpected GET request at /."
236236 end
237237
238238 test "with too many requests" do
@@ -249,7 +249,7 @@ defmodule TestServerTest do
249249 end
250250
251251 assert captured_io = capture_io ( fn -> ExUnit . run ( ) end )
252- assert captured_io =~ "Unexpected GET request received at / with params:"
252+ assert captured_io =~ "received an unexpected GET request at / with params:"
253253 assert captured_io =~ "query_params: %{\" a\" => \" 1\" }"
254254 end
255255
@@ -263,7 +263,7 @@ defmodule TestServerTest do
263263 end
264264
265265 assert capture_io ( fn -> ExUnit . run ( ) end ) =~
266- ~r / The test ended before the following TestServer \. Instance \# PID \< [0-9.]+ \> route \( s \) received a request /
266+ "did not receive a request for these routes before the test ended:"
267267 end
268268
269269 test "with callback plug" do
@@ -404,7 +404,7 @@ defmodule TestServerTest do
404404 TestServer . x509_suite ( )
405405 end
406406
407- assert_raise RuntimeError , ~r/ The TestServer\. Instance \# PID\< [0-9.]+\> is not running/ , fn ->
407+ assert_raise RuntimeError , ~r/ TestServer\. Instance \# PID\< [0-9.]+\> is not running/ , fn ->
408408 { :ok , instance } = TestServer . start ( )
409409
410410 assert :ok = TestServer . stop ( )
@@ -417,7 +417,7 @@ defmodule TestServerTest do
417417 TestServer . start ( )
418418
419419 assert_raise RuntimeError ,
420- "The TestServer.Instance is not running with `[scheme: :https]` option" ,
420+ ~r / TestServer\ . Instance \# PID \< [0-9.]+ \> is not running with `\ [ scheme: :https\ ] ` option/ ,
421421 fn ->
422422 TestServer . x509_suite ( )
423423 end
@@ -434,9 +434,11 @@ defmodule TestServerTest do
434434
435435 TestServer . start ( scheme: :https , cowboy_options: cowboy_options )
436436
437- assert_raise RuntimeError , ~r/ The TestServer\. Instance is running with custom SSL/ , fn ->
438- TestServer . x509_suite ( )
439- end
437+ assert_raise RuntimeError ,
438+ ~r/ TestServer\. Instance \# PID\< [0-9.]+\> is running with custom SSL/ ,
439+ fn ->
440+ TestServer . x509_suite ( )
441+ end
440442 end
441443 end
442444
@@ -445,7 +447,7 @@ defmodule TestServerTest do
445447 { :ok , instance } = TestServer . start ( )
446448 assert :ok = TestServer . stop ( )
447449
448- assert_raise RuntimeError , ~r/ The TestServer\. Instance \# PID\< [0-9.]+\> is not running/ , fn ->
450+ assert_raise RuntimeError , ~r/ TestServer\. Instance \# PID\< [0-9.]+\> is not running/ , fn ->
449451 TestServer . websocket_init ( instance , "/ws" )
450452 end
451453 end
@@ -474,7 +476,7 @@ defmodule TestServerTest do
474476 assert { :ok , socket } = TestServer . websocket_init ( "/ws" )
475477 assert :ok = TestServer . stop ( instance )
476478
477- assert_raise RuntimeError , ~r/ The TestServer\. Instance \# PID\< [0-9.]+\> is not running/ , fn ->
479+ assert_raise RuntimeError , ~r/ TestServer\. Instance \# PID\< [0-9.]+\> is not running/ , fn ->
478480 TestServer . websocket_handle ( socket )
479481 end
480482 end
@@ -501,10 +503,10 @@ defmodule TestServerTest do
501503 end
502504
503505 assert capture_io ( fn -> ExUnit . run ( ) end ) =~
504- ~r / The test ended before the following TestServer \. Instance \# PID \< [0-9.]+ \> websocket handler \( s \) received a message /
506+ "did not receive a frame for these websocket handlers before the test ended:"
505507 end
506508
507- test "when receiving unexpected message " do
509+ test "when receiving unexpected frame " do
508510 defmodule WebSocketHandleTooManyMessagesTest do
509511 use ExUnit.Case
510512
@@ -516,11 +518,11 @@ defmodule TestServerTest do
516518 assert WebSocketClient . send_message ( client , "ping" ) == :ok
517519
518520 assert WebSocketClient . send_message ( client , "ping" ) =~
519- "Unexpected message received for WebSocket"
521+ "received an unexpected WebSocket frame "
520522 end
521523 end
522524
523- assert capture_io ( fn -> ExUnit . run ( ) end ) =~ "Unexpected message received for WebSocket"
525+ assert capture_io ( fn -> ExUnit . run ( ) end ) =~ "received an unexpected WebSocket frame "
524526 end
525527
526528 test "with callback function raising exception" do
@@ -593,7 +595,7 @@ defmodule TestServerTest do
593595 assert { :ok , socket } = TestServer . websocket_init ( "/ws" )
594596 assert :ok = TestServer . stop ( instance )
595597
596- assert_raise RuntimeError , ~r/ The TestServer\. Instance \# PID\< [0-9.]+\> is not running/ , fn ->
598+ assert_raise RuntimeError , ~r/ TestServer\. Instance \# PID\< [0-9.]+\> is not running/ , fn ->
597599 TestServer . websocket_info ( socket )
598600 end
599601 end
0 commit comments