mirror of
https://github.com/onyx-and-iris/voicemeeter-rb.git
synced 2024-11-15 15:00:46 +00:00
test error messages and capierror fn_name
This commit is contained in:
parent
c3afc041fe
commit
ca17d337f1
@ -4,18 +4,21 @@ require_relative "../lib/voicemeeter"
|
|||||||
class CAPIErrorTest < Minitest::Test
|
class CAPIErrorTest < Minitest::Test
|
||||||
def test_it_raises_an_unknown_parameter_error
|
def test_it_raises_an_unknown_parameter_error
|
||||||
e = assert_raises(Voicemeeter::Errors::VMCAPIError) { Test.vm.set("Unknown.Parameter", 1) }
|
e = assert_raises(Voicemeeter::Errors::VMCAPIError) { Test.vm.set("Unknown.Parameter", 1) }
|
||||||
|
assert_equal(e.fn_name, "VBVMR_SetParameterFloat")
|
||||||
assert_equal(e.code, -3)
|
assert_equal(e.code, -3)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
class InvalidKindTest < MiniTest::Test
|
class InvalidKindTest < MiniTest::Test
|
||||||
def test_it_raises_an_invalid_kind_error
|
def test_it_raises_an_invalid_kind_error
|
||||||
assert_raises(Voicemeeter::Errors::VMError) { Voicemeeter::Remote.new("unknown_kind") }
|
e = assert_raises(Voicemeeter::Errors::VMError) { Voicemeeter::Remote.new("unknown_kind") }
|
||||||
|
assert_equal(e.message, "unknown Voicemeeter kind unknown_kind")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
class UnknownConfigTest < MiniTest::Test
|
class UnknownConfigTest < MiniTest::Test
|
||||||
def test_it_raises_an_unknown_config_error
|
def test_it_raises_an_unknown_config_error
|
||||||
assert_raises(Voicemeeter::Errors::VMError) { Test.vm.apply_config(:unknown) }
|
e = assert_raises(Voicemeeter::Errors::VMError) { Test.vm.apply_config(:unknown) }
|
||||||
|
assert_equal(e.message, "unknown config unknown. known configs: #{Test.vm.configs.keys}")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user