mirror of
https://github.com/onyx-and-iris/obsws-ruby.git
synced 2025-01-30 18:30:47 +00:00
check identified state in Event::Client
add passwordless test for event client patch bump
This commit is contained in:
parent
92174219a7
commit
7e580dc91a
@ -1,7 +1,7 @@
|
|||||||
PATH
|
PATH
|
||||||
remote: .
|
remote: .
|
||||||
specs:
|
specs:
|
||||||
obsws (0.5.6)
|
obsws (0.5.8)
|
||||||
waitutil (~> 0.2.1)
|
waitutil (~> 0.2.1)
|
||||||
websocket-driver (~> 0.7.5)
|
websocket-driver (~> 0.7.5)
|
||||||
|
|
||||||
|
@ -71,6 +71,11 @@ module OBSWS
|
|||||||
def initialize(**kwargs)
|
def initialize(**kwargs)
|
||||||
kwargs[:subs] ||= SUBS::LOW_VOLUME
|
kwargs[:subs] ||= SUBS::LOW_VOLUME
|
||||||
@base_client = Base.new(**kwargs)
|
@base_client = Base.new(**kwargs)
|
||||||
|
unless @base_client.identified.state == :identified
|
||||||
|
err_msg = @base_client.identified.error_message
|
||||||
|
logger.error(err_msg)
|
||||||
|
raise OBSWSConnectionError.new(err_msg)
|
||||||
|
end
|
||||||
logger.info("#{self} successfully identified with server")
|
logger.info("#{self} successfully identified with server")
|
||||||
rescue Errno::ECONNREFUSED, WaitUtil::TimeoutError => e
|
rescue Errno::ECONNREFUSED, WaitUtil::TimeoutError => e
|
||||||
msg = "#{e.class.name}: #{e.message}"
|
msg = "#{e.class.name}: #{e.message}"
|
||||||
|
@ -11,7 +11,7 @@ module OBSWS
|
|||||||
end
|
end
|
||||||
|
|
||||||
def patch
|
def patch
|
||||||
7
|
8
|
||||||
end
|
end
|
||||||
|
|
||||||
def to_a
|
def to_a
|
||||||
|
@ -9,13 +9,21 @@ class OBSWSConnectionErrorTest < Minitest::Test
|
|||||||
assert_equal("Timed out waiting for successful identification (0.1 seconds elapsed)", e.message)
|
assert_equal("Timed out waiting for successful identification (0.1 seconds elapsed)", e.message)
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_it_raises_an_obsws_connection_error_on_auth_enabled_but_no_password_provided
|
def test_it_raises_an_obsws_connection_error_on_auth_enabled_but_no_password_provided_for_request_client
|
||||||
e = assert_raises(OBSWS::OBSWSConnectionError) do
|
e = assert_raises(OBSWS::OBSWSConnectionError) do
|
||||||
OBSWS::Requests::Client
|
OBSWS::Requests::Client
|
||||||
.new(host: "localhost", port: 4455, password: "")
|
.new(host: "localhost", port: 4455, password: "")
|
||||||
end
|
end
|
||||||
assert_equal("auth enabled but no password provided", e.message)
|
assert_equal("auth enabled but no password provided", e.message)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_it_raises_an_obsws_connection_error_on_auth_enabled_but_no_password_provided_for_event_client
|
||||||
|
e = assert_raises(OBSWS::OBSWSConnectionError) do
|
||||||
|
OBSWS::Events::Client
|
||||||
|
.new(host: "localhost", port: 4455, password: "")
|
||||||
|
end
|
||||||
|
assert_equal("auth enabled but no password provided", e.message)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
class OBSWSRequestErrorTest < Minitest::Test
|
class OBSWSRequestErrorTest < Minitest::Test
|
||||||
|
Loading…
Reference in New Issue
Block a user