From 9c6d7ae907980870f364b2c8d4282fbc270cb202 Mon Sep 17 00:00:00 2001 From: Matthias Hecker Date: Sun, 29 Mar 2020 13:01:22 +0200 Subject: test: optional registry adapter tests --- test/test_registry.rb | 44 +++++++++++++++++++++++++------------------- 1 file changed, 25 insertions(+), 19 deletions(-) (limited to 'test') diff --git a/test/test_registry.rb b/test/test_registry.rb index 1f25f89d..097852aa 100644 --- a/test/test_registry.rb +++ b/test/test_registry.rb @@ -278,29 +278,35 @@ module RegistryTestModule end end -class RegistryDBMTest < Test::Unit::TestCase - include RegistryTestModule - include RegistryHashInterfaceTests - - def initialize(o) - super o - @format = 'dbm' - Irc::Bot::Registry.new(@format) - @registry_class = Irc::Bot::Registry::DBMAccessor +begin + require 'dbm' + class RegistryDBMTest < Test::Unit::TestCase + include RegistryTestModule + include RegistryHashInterfaceTests + + def initialize(o) + super o + @format = 'dbm' + Irc::Bot::Registry.new(@format) + @registry_class = Irc::Bot::Registry::DBMAccessor + end end -end +rescue Exception; end -class RegistryTCTest < Test::Unit::TestCase - include RegistryTestModule - include RegistryHashInterfaceTests +begin + require 'tc' + class RegistryTCTest < Test::Unit::TestCase + include RegistryTestModule + include RegistryHashInterfaceTests - def initialize(o) - super o - @format = 'tc' - Irc::Bot::Registry.new(@format) - @registry_class = Irc::Bot::Registry::TokyoCabinetAccessor + def initialize(o) + super o + @format = 'tc' + Irc::Bot::Registry.new(@format) + @registry_class = Irc::Bot::Registry::TokyoCabinetAccessor + end end -end +rescue Exception; end begin require 'daybreak' -- cgit v1.2.3