mirror of
https://github.com/onyx-and-iris/voicemeeter-rb.git
synced 2024-12-04 15:40:49 +00:00
remove message method override
fix expect, actual order in error tests
This commit is contained in:
parent
fe1de43250
commit
9e84d02707
@ -48,11 +48,7 @@ module Voicemeeter
|
|||||||
def initialize(fn_name, code)
|
def initialize(fn_name, code)
|
||||||
@fn_name = fn_name
|
@fn_name = fn_name
|
||||||
@code = code
|
@code = code
|
||||||
super(message)
|
super("#{fn_name} returned #{code}")
|
||||||
end
|
|
||||||
|
|
||||||
def message
|
|
||||||
"#{fn_name} returned #{code}"
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -4,22 +4,22 @@ require "voicemeeter"
|
|||||||
class CAPIErrorTest < Minitest::Test
|
class CAPIErrorTest < Minitest::Test
|
||||||
def test_it_raises_a_capierror_on_unknown_parameter
|
def test_it_raises_a_capierror_on_unknown_parameter
|
||||||
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("VBVMR_SetParameterFloat", e.fn_name)
|
||||||
assert_equal(e.code, -3)
|
assert_equal(-3, e.code)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
class InvalidKindTest < MiniTest::Test
|
class InvalidKindTest < MiniTest::Test
|
||||||
def test_it_raises_a_vmerror_on_invalid_kind
|
def test_it_raises_a_vmerror_on_invalid_kind
|
||||||
e = 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'")
|
assert_equal("unknown Voicemeeter kind 'unknown_kind'", e.message)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
class UnknownConfigTest < MiniTest::Test
|
class UnknownConfigTest < MiniTest::Test
|
||||||
def test_it_raises_a_vmerror_on_unknown_config_name
|
def test_it_raises_a_vmerror_on_unknown_config_name
|
||||||
e = 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}")
|
assert_equal("unknown config 'unknown'. known configs: #{Test.vm.configs.keys}", e.message)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -31,6 +31,6 @@ class UnknownConfigKey < MiniTest::Test
|
|||||||
"vban-out-3" => {on: true, bit: 24}
|
"vban-out-3" => {on: true, bit: 24}
|
||||||
}
|
}
|
||||||
e = assert_raises(KeyError) { Test.vm.apply(config) }
|
e = assert_raises(KeyError) { Test.vm.apply(config) }
|
||||||
assert_equal(e.message, "invalid config key 'unknown-0'")
|
assert_equal("invalid config key 'unknown-0'", e.message)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user