From 2da078a380ae9b89c52a0be10072edcf63975df8 Mon Sep 17 00:00:00 2001 From: onyx-and-iris Date: Mon, 7 Aug 2023 13:04:31 +0100 Subject: [PATCH] error tests added --- test/error_test.rb | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 test/error_test.rb diff --git a/test/error_test.rb b/test/error_test.rb new file mode 100644 index 0000000..09e84c1 --- /dev/null +++ b/test/error_test.rb @@ -0,0 +1,21 @@ +require_relative "minitest_helper" +require_relative "../lib/voicemeeter" + +class CAPIErrorTest < Minitest::Test + def test_it_raises_an_unknown_parameter_error + e = assert_raises(Voicemeeter::Errors::VMCAPIError) { Test.vm.set("Unknown.Parameter", 1) } + assert_equal(e.code, -3) + end +end + +class InvalidKindTest < MiniTest::Test + def test_it_raises_an_invalid_kind_error + assert_raises(Voicemeeter::Errors::VMError) { Voicemeeter::Remote.new("unknown_kind") } + end +end + +class UnknownConfigTest < MiniTest::Test + def test_it_raises_an_unknown_config_error + assert_raises(Voicemeeter::Errors::VMError) { Test.vm.apply_config(:unknown) } + end +end