refactor tests

This commit is contained in:
onyx-and-iris 2023-08-11 17:05:33 +01:00
parent 3ef4396885
commit 299351cac0
4 changed files with 8 additions and 5 deletions

View File

@ -1,7 +1,7 @@
PATH
remote: .
specs:
obsws (0.5.4)
obsws (0.5.5)
waitutil (~> 0.2.1)
websocket-driver (~> 0.7.5)

View File

@ -1,6 +1,6 @@
require_relative "../minitest_helper"
class AttrsTest < OBSWSTest
class AttrsTest < Minitest::Test
def test_get_version_attrs
resp = OBSWSTest.r_client.get_version
assert resp.attrs ==

View File

@ -2,8 +2,11 @@ require_relative "../minitest_helper"
class OBSWSConnectionErrorTest < Minitest::Test
def test_it_raises_an_obsws_connection_error_on_wrong_password
e = assert_raises(OBSWS::OBSWSConnectionError) { OBSWS::Requests::Client.new(host: "localhost", port: 4455, password: "wrongpassword", connect_timeout: 1).new }
assert_equal(e.message, "Timed out waiting for successful identification (1 seconds elapsed)")
e = assert_raises(OBSWS::OBSWSConnectionError) do
OBSWS::Requests::Client
.new(host: "localhost", port: 4455, password: "wrongpassword", connect_timeout: 0.1)
end
assert_equal(e.message, "Timed out waiting for successful identification (0.1 seconds elapsed)")
end
end

View File

@ -1,6 +1,6 @@
require_relative "../minitest_helper"
class RequestTest < OBSWSTest
class RequestTest < Minitest::Test
def test_it_checks_obs_major_version
resp = OBSWSTest.r_client.get_version
ver = resp.obs_version.split(".").map(&:to_i)