Sha256: 7f6d67e3adb2eda3e143e9b55b1362e30b3bd80d03440e81aef3ada6f8503972
Contents?: true
Size: 913 Bytes
Versions: 53
Compression:
Stored size: 913 Bytes
Contents
require File.expand_path('setup', File.dirname(__FILE__)) module TestLogging class TestFilter < Test::Unit::TestCase include LoggingTestCase def setup super ::Logging::init @lf = ::Logging::Filters::Level.new :debug, :warn end def test_level_filter_includes_selected_level debug_evt = event_for_level(:debug) warn_evt = event_for_level(:warn) assert_same debug_evt, @lf.allow(debug_evt), "Debug messages should be allowed" assert_same warn_evt, @lf.allow(warn_evt), "Warn messages should be allowed" end def test_level_filter_excludes_unselected_level event = event_for_level(:info) assert_nil @lf.allow(event), "Info messages should be disallowed" end def event_for_level(level) ::Logging::LogEvent.new('logger', ::Logging::LEVELS[level.to_s], 'message', false) end end end
Version data entries
53 entries across 45 versions & 4 rubygems