Sha256: 9398307e0231fe62d51d2f54cbe15c49a8e8b840c2b25b1c439e56815eac3359
Contents?: true
Size: 1.14 KB
Versions: 140
Compression:
Stored size: 1.14 KB
Contents
require File.join(File.expand_path(File.dirname(__FILE__)), '../..', 'test_helper.rb') require 'rbbt/util/log' class TestLog < Test::Unit::TestCase def test_get_level assert_equal 0, Log.get_level(:debug) assert_equal 1, Log.get_level(:low) assert_equal 1, Log.get_level("LOW") assert_equal 1, Log.get_level(1) assert_equal 0, Log.get_level(nil) end def test_color assert Log.color(:green, "green") end def test_no_stderr Log.ignore_stderr do STDERR.puts "NOPRINT" end end def test_trap_stderr Log.trap_stderr do STDERR.puts "NOPRINT" STDERR.puts "NOPRINT" STDERR.puts "NOPRINT" STDOUT.puts "PRINT STDOUT" STDOUT.puts "PRINT STDOUT" end Log.trap_stderr do STDERR.puts "NOPRINT" STDOUT.puts "PRINT STDOUT" end Log.trap_std do STDERR.puts "NOPRINT" STDOUT.puts "NOPRINT STDOUT" end end def test_trap_std Log.trap_std do STDERR.puts "NOPRINT STDERR" STDOUT.puts "NOPRINT STDOUT" end Log.trap_std "OUT", "ERR", 4, 2 do STDERR.puts "NOPRINT STDERR" STDOUT.puts "NOPRINT STDOUT" end end end
Version data entries
140 entries across 140 versions & 1 rubygems