anyt 1.1.2 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 657c46d114ddd104cbfb7ea98fc4196b2a465e4645b8f458e77c6a5508afc0db
4
- data.tar.gz: f53b2e08a5a5a091b7dd59ebc327310047c66204261c58a4306f889cb8577665
3
+ metadata.gz: 94cce22072abf225f715de0e1b343e2b94783eba7961778232bfb1508d4ebe6a
4
+ data.tar.gz: 00fd3d54c2f350c45440ba944e07388bd431668e3a28e34fa6c227b17081576c
5
5
  SHA512:
6
- metadata.gz: 38b058d39af9ff05aca21f2cad0aecb4c00c795fbd45e65576847170d38c88cd2cdbf7629ec726e52ba6c80e7c688e15dc7543d3b96a39298b9373cc1067888b
7
- data.tar.gz: 2df7835db36d97a4a333c525f0d81db7c2ba290d38752c4616105d4c58f5deedfaf08f45c22f37107382155beff2ba63f227a65fe7eee175b3add101bb26188c
6
+ metadata.gz: 9f64df7da832de830955aaf6906cf3a72b0984f4fc505db422e272e87aabdfc8ad39b05a9f48717fe2e523354ada94060e077a9ad4e457adb656a253579a3d49
7
+ data.tar.gz: 0b536582f0df8d7c2bf371fd4fd2cc1424ef289e7db40cc6a6afcbae68e577cf5422322ee0b013fae330f87f9a00778cb2a8be8f7794b246b4fcd0b4e8b87b34
data/lib/anyt/cli.rb CHANGED
@@ -173,7 +173,7 @@ module Anyt
173
173
  def wait_till_terminated
174
174
  self_read = setup_signals
175
175
 
176
- while readable_io = IO.select([self_read]) # rubocop:disable Lint/AssignmentInCondition
176
+ while readable_io = IO.select([self_read]) # rubocop:disable Lint/AssignmentInCondition, Lint/IncompatibleIoSelectWithFiberScheduler
177
177
  signal = readable_io.first[0].gets.strip
178
178
  raise Interrupt, "SIG#{signal} received"
179
179
  end
data/lib/anyt/client.rb CHANGED
@@ -12,12 +12,10 @@ module Anyt
12
12
  WAIT_WHEN_EXPECTING_EVENT = 5
13
13
  WAIT_WHEN_NOT_EXPECTING_EVENT = 0.5
14
14
 
15
- # rubocop: disable Metrics/AbcSize
16
- # rubocop: disable Metrics/MethodLength
17
- # rubocop: disable Metrics/BlockLength
18
15
  def initialize(
19
16
  ignore: [], url: Anyt.config.target_url, qs: "",
20
17
  cookies: "", headers: {},
18
+ protocol: "actioncable-v1-json",
21
19
  timeout_multiplier: Anyt.config.timeout_multiplier
22
20
  )
23
21
  ignore_message_types = @ignore_message_types = ignore
@@ -28,6 +26,7 @@ module Anyt
28
26
  @timeout_multiplier = timeout_multiplier
29
27
 
30
28
  headers = headers.merge("cookie" => cookies)
29
+ headers["Sec-WebSocket-Protocol"] = protocol
31
30
 
32
31
  open = Concurrent::Promise.new
33
32
 
data/lib/anyt/command.rb CHANGED
@@ -6,8 +6,6 @@ module Anyt
6
6
  # Runs system command (websocket server)
7
7
  module Command
8
8
  class << self
9
- # rubocop: disable Metrics/MethodLength
10
- # rubocop: disable Metrics/AbcSize
11
9
  def run
12
10
  return if running?
13
11
 
@@ -13,7 +13,7 @@ class TestApp < Rails::Application
13
13
  secrets.secret_token = "secret_token"
14
14
  secrets.secret_key_base = "secret_key_base"
15
15
 
16
- config.logger = Logger.new(STDOUT)
16
+ config.logger = Logger.new($stdout)
17
17
  config.log_level = AnyCable.config.log_level
18
18
  config.eager_load = true
19
19
 
@@ -30,6 +30,20 @@ module Anyt
30
30
  def remote_client
31
31
  @remote_client ||= RemoteControl::Client.connect(Anyt.config.remote_control_port)
32
32
  end
33
+
34
+ # Verifies that the actual message Hash is a subset of the expected one
35
+ # (so we can ignore some irrelevant fields)
36
+ def assert_message(expected, actual)
37
+ assert_equal expected, actual.slice(*expected.keys)
38
+ end
39
+
40
+ def assert_includes_message(collection, expected)
41
+ found = collection.find do |el|
42
+ el.slice(*expected.keys) == expected
43
+ end
44
+
45
+ assert found, "Expecte #{collection} to include a message matching #{expected}"
46
+ end
33
47
  end
34
48
  end
35
49
 
@@ -7,7 +7,7 @@ module Anyt
7
7
  module RemoteControl
8
8
  class Server
9
9
  class << self
10
- alias start new
10
+ alias_method :start, :new
11
11
  end
12
12
 
13
13
  def initialize(port)
data/lib/anyt/rpc.rb CHANGED
@@ -13,7 +13,6 @@ module Anyt # :nodoc:
13
13
  attr_accessor :running
14
14
  attr_reader :server
15
15
 
16
- # rubocop: disable Metrics/AbcSize,Metrics/MethodLength
17
16
  def start
18
17
  AnyCable.logger.debug "Starting RPC server ..."
19
18
 
@@ -24,6 +23,10 @@ module Anyt # :nodoc:
24
23
  **AnyCable.config.to_grpc_params
25
24
  )
26
25
 
26
+ if defined?(::AnyCable::Middlewares::EnvSid)
27
+ AnyCable.middleware.use(::AnyCable::Middlewares::EnvSid)
28
+ end
29
+
27
30
  AnyCable.middleware.freeze
28
31
 
29
32
  server.start
@@ -13,7 +13,7 @@ feature "Ping" do
13
13
 
14
14
  current_stamp = ping["message"]
15
15
 
16
- assert_equal ping["type"], "ping"
16
+ assert_equal "ping", ping["type"]
17
17
  assert_kind_of Integer, current_stamp
18
18
  refute_operator previous_stamp, :>=, current_stamp
19
19
 
@@ -5,6 +5,6 @@ feature "Welcome" do
5
5
  Client receives "welcome" message
6
6
  ) do
7
7
  client = build_client(ignore: ["ping"])
8
- assert_equal client.receive, "type" => "welcome"
8
+ assert_message({"type" => "welcome"}, client.receive)
9
9
  end
10
10
  end
@@ -37,7 +37,7 @@ feature "Channel state" do
37
37
  "identifier" => identifier, "type" => "confirm_subscription"
38
38
  }
39
39
 
40
- assert_equal ack, client.receive
40
+ assert_message ack, client.receive
41
41
  end
42
42
 
43
43
  scenario %(
@@ -53,7 +53,7 @@ feature "Channel state" do
53
53
 
54
54
  msg = {"identifier" => identifier, "message" => {"count" => 3, "name" => "chipolino"}}
55
55
 
56
- assert_equal msg, client.receive
56
+ assert_message msg, client.receive
57
57
  end
58
58
 
59
59
  scenario %(
@@ -67,7 +67,7 @@ feature "Channel state" do
67
67
  "identifier" => identifier2, "type" => "confirm_subscription"
68
68
  }
69
69
 
70
- assert_equal ack, client2.receive
70
+ assert_message ack, client2.receive
71
71
 
72
72
  client2.close
73
73
 
@@ -76,6 +76,6 @@ feature "Channel state" do
76
76
  "message" => {"data" => "user left: chipollone"}
77
77
  }
78
78
 
79
- assert_equal msg, client.receive
79
+ assert_message msg, client.receive
80
80
  end
81
81
  end
@@ -10,7 +10,7 @@ feature "Remote disconnect" do
10
10
  Close single connection by id
11
11
  ) do
12
12
  client = build_client(qs: "test=uid&uid=26", ignore: %w[ping])
13
- assert_equal client.receive, "type" => "welcome"
13
+ assert_message({"type" => "welcome"}, client.receive)
14
14
 
15
15
  # Prevent race conditions when we send disconnect before internal channel subscription has been made
16
16
  # (only for Action Cable)
@@ -19,11 +19,13 @@ feature "Remote disconnect" do
19
19
 
20
20
  # Waiting for https://github.com/rails/rails/pull/39544
21
21
  unless Anyt.config.use_action_cable
22
- assert_equal(
23
- client.receive,
24
- "type" => "disconnect",
25
- "reconnect" => true,
26
- "reason" => "remote"
22
+ assert_message(
23
+ {
24
+ "type" => "disconnect",
25
+ "reconnect" => true,
26
+ "reason" => "remote"
27
+ },
28
+ client.receive
27
29
  )
28
30
  end
29
31
 
@@ -14,15 +14,17 @@ feature "Server restart" do
14
14
  ignore: %(ping)
15
15
  )
16
16
 
17
- assert_equal client.receive, "type" => "welcome"
17
+ assert_message({"type" => "welcome"}, client.receive)
18
18
 
19
19
  restart_server!
20
20
 
21
- assert_equal(
22
- client.receive,
23
- "type" => "disconnect",
24
- "reconnect" => true,
25
- "reason" => "server_restart"
21
+ assert_message(
22
+ {
23
+ "type" => "disconnect",
24
+ "reconnect" => true,
25
+ "reason" => "server_restart"
26
+ },
27
+ client.receive
26
28
  )
27
29
  end
28
30
  end
@@ -13,7 +13,7 @@ feature "Request" do
13
13
  Channel has access to request
14
14
  ) do
15
15
  client = build_client(qs: "token=secret", ignore: %w[ping])
16
- assert_equal client.receive, "type" => "welcome"
16
+ assert_message({"type" => "welcome"}, client.receive)
17
17
 
18
18
  subscribe_request = {command: "subscribe", identifier: {channel: channel}.to_json}
19
19
 
@@ -23,6 +23,6 @@ feature "Request" do
23
23
  "identifier" => {channel: channel}.to_json, "type" => "confirm_subscription"
24
24
  }
25
25
 
26
- assert_equal ack, client.receive
26
+ assert_message ack, client.receive
27
27
  end
28
28
  end
@@ -11,7 +11,7 @@ feature "Request" do
11
11
  Url is set during connection
12
12
  ) do
13
13
  client = build_client(qs: "test=request_url")
14
- assert_equal client.receive, "type" => "welcome"
14
+ assert_message({"type" => "welcome"}, client.receive)
15
15
  end
16
16
 
17
17
  connect_handler("cookies") do
@@ -30,7 +30,7 @@ feature "Request" do
30
30
  Accepts when required cookies are set
31
31
  ) do
32
32
  client = build_client(qs: "test=cookies", cookies: "username=john green")
33
- assert_equal client.receive, "type" => "welcome"
33
+ assert_message({"type" => "welcome"}, client.receive)
34
34
  end
35
35
 
36
36
  connect_handler("headers") do
@@ -49,6 +49,6 @@ feature "Request" do
49
49
  Accepts when required header is set
50
50
  ) do
51
51
  client = build_client(qs: "test=headers", headers: {"x-api-token" => "abc"})
52
- assert_equal client.receive, "type" => "welcome"
52
+ assert_message({"type" => "welcome"}, client.receive)
53
53
  end
54
54
  end
@@ -10,11 +10,13 @@ feature "Request" do
10
10
  Receives disconnect message when rejected
11
11
  ) do
12
12
  client = build_client(qs: "test=reasons&reason=unauthorized")
13
- assert_equal(
14
- client.receive,
15
- "type" => "disconnect",
16
- "reconnect" => false,
17
- "reason" => "unauthorized"
13
+ assert_message(
14
+ {
15
+ "type" => "disconnect",
16
+ "reconnect" => false,
17
+ "reason" => "unauthorized"
18
+ },
19
+ client.receive
18
20
  )
19
21
 
20
22
  client.wait_for_close
@@ -45,7 +45,7 @@ feature "Request" do
45
45
  "identifier" => {channel: a_channel}.to_json, "type" => "confirm_subscription"
46
46
  }
47
47
 
48
- assert_equal ack, client.receive
48
+ assert_message ack, client.receive
49
49
 
50
50
  subscribe_request = {command: "subscribe", identifier: {channel: b_channel}.to_json}
51
51
 
@@ -55,7 +55,7 @@ feature "Request" do
55
55
  "identifier" => {channel: b_channel}.to_json, "type" => "confirm_subscription"
56
56
  }
57
57
 
58
- assert_equal ack, client.receive
58
+ assert_message ack, client.receive
59
59
 
60
60
  subscribe_request = {command: "subscribe", identifier: {channel: a_channel}.to_json}
61
61
 
@@ -65,7 +65,7 @@ feature "Request" do
65
65
  "identifier" => {channel: a_channel}.to_json, "type" => "confirm_subscription"
66
66
  }
67
67
 
68
- assert_equal ack, client2.receive
68
+ assert_message ack, client2.receive
69
69
 
70
70
  subscribe_request = {command: "subscribe", identifier: {channel: b_channel}.to_json}
71
71
 
@@ -75,7 +75,7 @@ feature "Request" do
75
75
  "identifier" => {channel: b_channel}.to_json, "type" => "confirm_subscription"
76
76
  }
77
77
 
78
- assert_equal ack, client2.receive
78
+ assert_message ack, client2.receive
79
79
 
80
80
  client2.close
81
81
 
@@ -90,8 +90,8 @@ feature "Request" do
90
90
 
91
91
  msgs = [client.receive, client.receive]
92
92
 
93
- assert_includes msgs, msg
94
- assert_includes msgs, msg2
93
+ assert_includes_message msgs, msg
94
+ assert_includes_message msgs, msg2
95
95
  end
96
96
 
97
97
  scenario %(
@@ -106,7 +106,7 @@ feature "Request" do
106
106
  "identifier" => {channel: c_channel}.to_json, "type" => "confirm_subscription"
107
107
  }
108
108
 
109
- assert_equal ack, client.receive
109
+ assert_message ack, client.receive
110
110
 
111
111
  subscribe_request = {command: "subscribe", identifier: {channel: c_channel, id: 1}.to_json}
112
112
 
@@ -116,7 +116,7 @@ feature "Request" do
116
116
  "identifier" => {channel: c_channel, id: 1}.to_json, "type" => "confirm_subscription"
117
117
  }
118
118
 
119
- assert_equal ack, client2.receive
119
+ assert_message ack, client2.receive
120
120
 
121
121
  subscribe_request = {command: "subscribe", identifier: {channel: c_channel, id: 2}.to_json}
122
122
 
@@ -126,7 +126,7 @@ feature "Request" do
126
126
  "identifier" => {channel: c_channel, id: 2}.to_json, "type" => "confirm_subscription"
127
127
  }
128
128
 
129
- assert_equal ack, client2.receive
129
+ assert_message ack, client2.receive
130
130
 
131
131
  client2.close
132
132
 
@@ -142,7 +142,7 @@ feature "Request" do
142
142
 
143
143
  msgs = [client.receive, client.receive]
144
144
 
145
- assert_includes msgs, msg
146
- assert_includes msgs, msg2
145
+ assert_includes_message msgs, msg
146
+ assert_includes_message msgs, msg2
147
147
  end
148
148
  end
@@ -16,7 +16,7 @@ feature "Broadcast data to stream" do
16
16
  "identifier" => {channel: channel}.to_json, "type" => "confirm_subscription"
17
17
  }
18
18
 
19
- assert_equal ack, client.receive
19
+ assert_message ack, client.receive
20
20
  end
21
21
 
22
22
  scenario %(
@@ -34,7 +34,7 @@ feature "Broadcast data to stream" do
34
34
  }
35
35
  }
36
36
 
37
- assert_equal msg, client.receive
37
+ assert_message msg, client.receive
38
38
  end
39
39
 
40
40
  scenario %(
@@ -47,7 +47,7 @@ feature "Broadcast data to stream" do
47
47
  "message" => "<script>alert('Message!');</script>"
48
48
  }
49
49
 
50
- assert_equal msg, client.receive
50
+ assert_message msg, client.receive
51
51
  end
52
52
 
53
53
  scenario %(
@@ -60,6 +60,6 @@ feature "Broadcast data to stream" do
60
60
  "message" => '{"script":{"alert":"Message!"}}'
61
61
  }
62
62
 
63
- assert_equal msg, client.receive
63
+ assert_message msg, client.receive
64
64
  end
65
65
  end
@@ -19,8 +19,8 @@ feature "Streams with many clients" do
19
19
  "identifier" => {channel: channel}.to_json, "type" => "confirm_subscription"
20
20
  }
21
21
 
22
- assert_equal ack, client.receive
23
- assert_equal ack, client2.receive
22
+ assert_message ack, client.receive
23
+ assert_message ack, client2.receive
24
24
  end
25
25
 
26
26
  scenario %(
@@ -30,8 +30,8 @@ feature "Streams with many clients" do
30
30
 
31
31
  msg = {"identifier" => {channel: channel}.to_json, "message" => {"data" => "X"}}
32
32
 
33
- assert_equal msg, client.receive
34
- assert_equal msg, client2.receive
33
+ assert_message msg, client.receive
34
+ assert_message msg, client2.receive
35
35
  end
36
36
 
37
37
  scenario %(
@@ -41,8 +41,8 @@ feature "Streams with many clients" do
41
41
 
42
42
  msg = {"identifier" => {channel: channel}.to_json, "message" => {"data" => "X"}}
43
43
 
44
- assert_equal msg, client.receive
45
- assert_equal msg, client2.receive
44
+ assert_message msg, client.receive
45
+ assert_message msg, client2.receive
46
46
 
47
47
  unsubscribe_request = {command: "unsubscribe", identifier: {channel: channel}.to_json}
48
48
 
@@ -55,7 +55,7 @@ feature "Streams with many clients" do
55
55
 
56
56
  msg2 = {"identifier" => {channel: channel}.to_json, "message" => {"data" => "Y"}}
57
57
 
58
- assert_equal msg2, client2.receive
58
+ assert_message msg2, client2.receive
59
59
  assert_raises(Anyt::Client::TimeoutError) { client.receive(timeout: 0.5) }
60
60
  end
61
61
  end
@@ -17,7 +17,7 @@ feature "Multiple streams" do
17
17
  "identifier" => {channel: channel}.to_json, "type" => "confirm_subscription"
18
18
  }
19
19
 
20
- assert_equal ack, client.receive
20
+ assert_message ack, client.receive
21
21
  end
22
22
 
23
23
  scenario %(
@@ -27,13 +27,13 @@ feature "Multiple streams" do
27
27
 
28
28
  msg = {"identifier" => {channel: channel}.to_json, "message" => {"data" => "X"}}
29
29
 
30
- assert_equal msg, client.receive
30
+ assert_message msg, client.receive
31
31
 
32
32
  ActionCable.server.broadcast("b", {data: "Y"})
33
33
 
34
34
  msg = {"identifier" => {channel: channel}.to_json, "message" => {"data" => "Y"}}
35
35
 
36
- assert_equal msg, client.receive
36
+ assert_message msg, client.receive
37
37
  end
38
38
 
39
39
  scenario %(
@@ -43,7 +43,7 @@ feature "Multiple streams" do
43
43
 
44
44
  msg = {"identifier" => {channel: channel}.to_json, "message" => {"data" => "X"}}
45
45
 
46
- assert_equal msg, client.receive
46
+ assert_message msg, client.receive
47
47
 
48
48
  unsubscribe_request = {command: "unsubscribe", identifier: {channel: channel}.to_json}
49
49
 
@@ -16,7 +16,7 @@ feature "Single stream" do
16
16
  "identifier" => {channel: channel}.to_json, "type" => "confirm_subscription"
17
17
  }
18
18
 
19
- assert_equal ack, client.receive
19
+ assert_message ack, client.receive
20
20
  end
21
21
 
22
22
  scenario %(
@@ -26,13 +26,13 @@ feature "Single stream" do
26
26
 
27
27
  msg = {"identifier" => {channel: channel}.to_json, "message" => {"data" => "X"}}
28
28
 
29
- assert_equal msg, client.receive
29
+ assert_message msg, client.receive
30
30
 
31
31
  ActionCable.server.broadcast("a", {data: "Y"})
32
32
 
33
33
  msg = {"identifier" => {channel: channel}.to_json, "message" => {"data" => "Y"}}
34
34
 
35
- assert_equal msg, client.receive
35
+ assert_message msg, client.receive
36
36
  end
37
37
 
38
38
  scenario %(
@@ -42,7 +42,7 @@ feature "Single stream" do
42
42
 
43
43
  msg = {"identifier" => {channel: channel}.to_json, "message" => {"data" => "X"}}
44
44
 
45
- assert_equal msg, client.receive
45
+ assert_message msg, client.receive
46
46
 
47
47
  unsubscribe_request = {command: "unsubscribe", identifier: {channel: channel}.to_json}
48
48
 
@@ -68,7 +68,7 @@ feature "Single stream" do
68
68
  "identifier" => {channel: channel, some_param: "test"}.to_json, "type" => "confirm_subscription"
69
69
  }
70
70
 
71
- assert_equal ack, client.receive
71
+ assert_message ack, client.receive
72
72
 
73
73
  ActionCable.server.broadcast("a", {data: "XX"})
74
74
 
@@ -77,7 +77,7 @@ feature "Single stream" do
77
77
 
78
78
  received = client.receive, client.receive
79
79
 
80
- assert_includes received, msg
81
- assert_includes received, msg2
80
+ assert_includes_message received, msg
81
+ assert_includes_message received, msg2
82
82
  end
83
83
  end
@@ -25,7 +25,7 @@ feature "Stop streams" do
25
25
  "identifier" => {channel: channel}.to_json, "type" => "confirm_subscription"
26
26
  }
27
27
 
28
- assert_equal ack, client.receive
28
+ assert_message ack, client.receive
29
29
  end
30
30
 
31
31
  scenario %(
@@ -37,7 +37,7 @@ feature "Stop streams" do
37
37
 
38
38
  msg = {"identifier" => {channel: channel}.to_json, "message" => {"data" => "X"}}
39
39
 
40
- assert_equal msg, client.receive
40
+ assert_message msg, client.receive
41
41
 
42
42
  perform_request = {
43
43
  :command => "message",
@@ -52,6 +52,6 @@ feature "Stop streams" do
52
52
  ActionCable.server.broadcast("b", {data: "Z"})
53
53
 
54
54
  msg = {"identifier" => {channel: channel}.to_json, "message" => {"data" => "Z"}}
55
- assert_equal msg, client.receive
55
+ assert_message msg, client.receive
56
56
  end
57
57
  end
@@ -20,7 +20,7 @@ feature "Subscription aknowledgement" do
20
20
  "identifier" => {channel: channel}.to_json, "type" => "confirm_subscription"
21
21
  }
22
22
 
23
- assert_equal ack, client.receive
23
+ assert_message ack, client.receive
24
24
  end
25
25
 
26
26
  scenario %(
@@ -34,6 +34,6 @@ feature "Subscription aknowledgement" do
34
34
  "identifier" => {channel: rejector_channel}.to_json, "type" => "reject_subscription"
35
35
  }
36
36
 
37
- assert_equal ack, client.receive
37
+ assert_message ack, client.receive
38
38
  end
39
39
  end
@@ -14,7 +14,7 @@ feature "Subscription with params" do
14
14
  "identifier" => {channel: channel, id: 1}.to_json, "type" => "confirm_subscription"
15
15
  }
16
16
 
17
- assert_equal ack, client.receive
17
+ assert_message ack, client.receive
18
18
 
19
19
  subscribe_request_2 = {command: "subscribe", identifier: {channel: channel, id: 2}.to_json}
20
20
 
@@ -24,6 +24,6 @@ feature "Subscription with params" do
24
24
  "identifier" => {channel: channel, id: 2}.to_json, "type" => "confirm_subscription"
25
25
  }
26
26
 
27
- assert_equal ack, client.receive
27
+ assert_message ack, client.receive
28
28
  end
29
29
  end
@@ -23,7 +23,7 @@ feature "Subscription perform methods" do
23
23
  "identifier" => {channel: channel}.to_json, "type" => "confirm_subscription"
24
24
  }
25
25
 
26
- assert_equal ack, client.receive
26
+ assert_message ack, client.receive
27
27
  end
28
28
 
29
29
  scenario %(
@@ -39,7 +39,7 @@ feature "Subscription perform methods" do
39
39
 
40
40
  msg = {"identifier" => {channel: channel}.to_json, "message" => "tock"}
41
41
 
42
- assert_equal msg, client.receive
42
+ assert_message msg, client.receive
43
43
  end
44
44
 
45
45
  scenario %(
@@ -55,6 +55,6 @@ feature "Subscription perform methods" do
55
55
 
56
56
  msg = {"identifier" => {channel: channel}.to_json, "message" => {"response" => "hello"}}
57
57
 
58
- assert_equal msg, client.receive
58
+ assert_message msg, client.receive
59
59
  end
60
60
  end
@@ -17,16 +17,16 @@ feature "Subscription transmissions" do
17
17
 
18
18
  msg = {"identifier" => {channel: channel}.to_json, "message" => "hello"}
19
19
 
20
- assert_equal msg, client.receive
20
+ assert_message msg, client.receive
21
21
 
22
22
  msg = {"identifier" => {channel: channel}.to_json, "message" => "world"}
23
23
 
24
- assert_equal msg, client.receive
24
+ assert_message msg, client.receive
25
25
 
26
26
  ack = {
27
27
  "identifier" => {channel: channel}.to_json, "type" => "confirm_subscription"
28
28
  }
29
29
 
30
- assert_equal ack, client.receive
30
+ assert_message ack, client.receive
31
31
  end
32
32
  end
data/lib/anyt/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Anyt
4
- VERSION = "1.1.2"
4
+ VERSION = "1.2.0"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: anyt
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.2
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - palkan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-02-21 00:00:00.000000000 Z
11
+ date: 2022-04-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rack
@@ -148,14 +148,14 @@ dependencies:
148
148
  requirements:
149
149
  - - "~>"
150
150
  - !ruby/object:Gem::Version
151
- version: 1.0.0
151
+ version: '1.0'
152
152
  type: :runtime
153
153
  prerelease: false
154
154
  version_requirements: !ruby/object:Gem::Requirement
155
155
  requirements:
156
156
  - - "~>"
157
157
  - !ruby/object:Gem::Version
158
- version: 1.0.0
158
+ version: '1.0'
159
159
  - !ruby/object:Gem::Dependency
160
160
  name: childprocess
161
161
  requirement: !ruby/object:Gem::Requirement
@@ -271,14 +271,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
271
271
  requirements:
272
272
  - - ">="
273
273
  - !ruby/object:Gem::Version
274
- version: '0'
274
+ version: 2.6.0
275
275
  required_rubygems_version: !ruby/object:Gem::Requirement
276
276
  requirements:
277
277
  - - ">="
278
278
  - !ruby/object:Gem::Version
279
279
  version: '0'
280
280
  requirements: []
281
- rubygems_version: 3.2.22
281
+ rubygems_version: 3.3.7
282
282
  signing_key:
283
283
  specification_version: 4
284
284
  summary: Anycable conformance testing tool