From 650800a18f5b1202a8730a07ca4a4ffaece90f4c Mon Sep 17 00:00:00 2001 From: onyx-and-iris Date: Sat, 29 Jul 2023 21:36:22 +0100 Subject: [PATCH] add factory tests --- test/factory_test.rb | 52 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 test/factory_test.rb diff --git a/test/factory_test.rb b/test/factory_test.rb new file mode 100644 index 0000000..9e153bd --- /dev/null +++ b/test/factory_test.rb @@ -0,0 +1,52 @@ +require_relative "minitest_helper" + +class BasicFactoryTest < Minitest::Test + if Test.data.name == :basic + define_method("test_it_tests_#{Test.data.name}_kind_factory") do + %i[strip bus button vban command device option].each do + assert(Test.vm.respond_to?(_1)) + end + end + + define_method("test_it_tests_#{Test.data.name}_kind_factory_steps") do + assert(Test.vm.strip.length == 3) + assert(Test.vm.bus.length == 2) + assert(Test.vm.button.length == 80) + assert(Test.vm.vban.instream.length == 4 && Test.vm.vban.outstream.length == 4) + end + end +end + +class BananaFactoryTest < Minitest::Test + if Test.data.name == :banana + define_method("test_it_tests_#{Test.data.name}_kind_factory") do + %i[strip bus button vban command device option recorder patch].each do + assert(Test.vm.respond_to?(_1)) + end + end + + define_method("test_it_tests_#{Test.data.name}_kind_factory_steps") do + assert(Test.vm.strip.length == 5) + assert(Test.vm.bus.length == 5) + assert(Test.vm.button.length == 80) + assert(Test.vm.vban.instream.length == 8 && Test.vm.vban.outstream.length == 8) + end + end +end + +class PotatoFactoryTest < Minitest::Test + if Test.data.name == :potato + define_method("test_it_tests_#{Test.data.name}_kind_factory") do + %i[strip bus button vban command device option recorder patch fx].each do + assert(Test.vm.respond_to?(_1)) + end + end + + define_method("test_it_tests_#{Test.data.name}_kind_factory_steps") do + assert(Test.vm.strip.length == 8) + assert(Test.vm.bus.length == 8) + assert(Test.vm.button.length == 80) + assert(Test.vm.vban.instream.length == 8 && Test.vm.vban.outstream.length == 8) + end + end +end