Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions spec/websocket/session_spec.cr
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
status_name = "nugget"

id = rand(10).to_i64
results = test_websocket_api(Systems.base_route, Spec::Authentication.headers) do |ws, control_system, mod|
results = test_websocket_api(Systems.base_route, Spec::Authentication.headers) do |ws, control_system, mod, updates|
request = {
id: id,
system_id: control_system.id.as(String),
Expand All @@ -74,9 +74,9 @@
command: Session::Request::Command::Bind,
}
ws.send Session::Request.new(**request).to_json
sleep 100.milliseconds
wait_for_updates(updates, 1)
ws.send Session::Request.new(**request.merge({command: Session::Request::Command::Bind})).to_json
sleep 100.milliseconds
wait_for_updates(updates, 2)
end

updates, control_system, mod = results
Expand Down Expand Up @@ -121,7 +121,7 @@
status_name = "nugget"

id = rand(10).to_i64
updates, _, _ = test_websocket_api(Systems.base_route, Spec::Authentication.headers) do |ws, control_system, mod|
updates, _, _ = test_websocket_api(Systems.base_route, Spec::Authentication.headers) do |ws, control_system, mod, updates|

Check warning on line 124 in spec/websocket/session_spec.cr

View workflow job for this annotation

GitHub Actions / Ameba

Lint/ShadowingOuterLocalVar

Shadowing outer local variable `updates`
Raw output
> updates, _, _ = test_websocket_api(Systems.base_route, Spec::Authentication.headers) do |ws, control_system, mod, updates|
                                                                                                                    ^
request = {
id: id,
system_id: control_system.id.as(String),
Expand All @@ -130,7 +130,7 @@
command: Session::Request::Command::Debug,
}
ws.send Session::Request.new(**request).to_json
sleep 100.milliseconds
wait_for_updates(updates, 1)
end

# Check all messages received
Expand All @@ -143,7 +143,7 @@
status_name = "nugget"

id = rand(10).to_i64
updates, _, _ = test_websocket_api(Systems.base_route, Spec::Authentication.headers) do |ws, control_system, mod|
updates, _, _ = test_websocket_api(Systems.base_route, Spec::Authentication.headers) do |ws, control_system, mod, updates|

Check warning on line 146 in spec/websocket/session_spec.cr

View workflow job for this annotation

GitHub Actions / Ameba

Lint/ShadowingOuterLocalVar

Shadowing outer local variable `updates`
Raw output
> updates, _, _ = test_websocket_api(Systems.base_route, Spec::Authentication.headers) do |ws, control_system, mod, updates|
                                                                                                                    ^
request = {
id: id,
system_id: control_system.id.as(String),
Expand All @@ -152,7 +152,7 @@
command: Session::Request::Command::Ignore,
}
ws.send Session::Request.new(**request).to_json
sleep 100.milliseconds
wait_for_updates(updates, 1)
end

# Check all messages received
Expand Down
Loading