From: Matthias Hecker Date: Sun, 29 Mar 2020 11:01:22 +0000 (+0200) Subject: test: optional registry adapter tests X-Git-Url: https://git.netwichtig.de/gitweb/?a=commitdiff_plain;h=9c6d7ae907980870f364b2c8d4282fbc270cb202;p=user%2Fhenk%2Fcode%2Fruby%2Frbot.git test: optional registry adapter tests --- 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'