2023-08-07 13:04:31 +01:00
|
|
|
require_relative "minitest_helper"
|
2023-08-07 22:32:35 +01:00
|
|
|
require "voicemeeter"
|
2023-08-07 13:04:31 +01:00
|
|
|
|
|
|
|
class CAPIErrorTest < Minitest::Test
|
|
|
|
def test_it_raises_an_unknown_parameter_error
|
|
|
|
e = assert_raises(Voicemeeter::Errors::VMCAPIError) { Test.vm.set("Unknown.Parameter", 1) }
|
2023-08-07 13:16:01 +01:00
|
|
|
assert_equal(e.fn_name, "VBVMR_SetParameterFloat")
|
2023-08-07 13:04:31 +01:00
|
|
|
assert_equal(e.code, -3)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
class InvalidKindTest < MiniTest::Test
|
|
|
|
def test_it_raises_an_invalid_kind_error
|
2023-08-07 13:16:01 +01:00
|
|
|
e = assert_raises(Voicemeeter::Errors::VMError) { Voicemeeter::Remote.new("unknown_kind") }
|
|
|
|
assert_equal(e.message, "unknown Voicemeeter kind unknown_kind")
|
2023-08-07 13:04:31 +01:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
class UnknownConfigTest < MiniTest::Test
|
|
|
|
def test_it_raises_an_unknown_config_error
|
2023-08-07 13:16:01 +01:00
|
|
|
e = assert_raises(Voicemeeter::Errors::VMError) { Test.vm.apply_config(:unknown) }
|
|
|
|
assert_equal(e.message, "unknown config unknown. known configs: #{Test.vm.configs.keys}")
|
2023-08-07 13:04:31 +01:00
|
|
|
end
|
|
|
|
end
|