Sha256: 68aaa79ba418bf4fe93195d4111b1586d96b83a3889524b3bf00460d2d55bb2c

Contents?: true

Size: 1.52 KB

Versions: 6

Compression:

Stored size: 1.52 KB

Contents

require 'pione/test-helper'

describe "Pione::Log::Debug" do
  before do
    @out = StringIO.new
    @orig = Global.system_logger
    Global.system_logger = Log::PioneSystemLogger.new(@out)
    Global.system_logger.level = :debug
  end

  after do
    Global.system_logger = @orig
    Global.debug_system = false
    Global.debug_rule_engine = false
    Global.debug_communication = false
    Global.debug_notification = false
    Global.debug_ignored_exception = false
  end

  it "should print system debug message" do
    Global.debug_system = true
    Log::Debug.system("XYZ")
    sleep 0.1 while Global.system_logger.queued?
    @out.string.should.include("XYZ")
  end

  it "should print rule-engine debug message" do
    Global.debug_rule_engine = true
    Log::Debug.rule_engine("XYZ")
    sleep 0.1 while Global.system_logger.queued?
    @out.string.should.include("XYZ")
  end

  it "should print communication debug message" do
    Global.debug_communication = true
    Log::Debug.communication("XYZ")
    sleep 0.1 while Global.system_logger.queued?
    @out.string.should.include("XYZ")
  end

  it "should print notification debug message" do
    Global.debug_notification = true
    Log::Debug.notification("XYZ")
    sleep 0.1 while Global.system_logger.queued?
    @out.string.should.include("XYZ")
  end

  it "should print ignored_exception debug message" do
    Global.debug_ignored_exception = true
    Log::Debug.ignored_exception("XYZ")
    sleep 0.1 while Global.system_logger.queued?
    @out.string.should.include("XYZ")
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
pione-0.5.0 test/log/spec_debug.rb
pione-0.5.0.alpha.2 test/log/spec_debug.rb
pione-0.5.0.alpha.1 test/log/spec_debug.rb
pione-0.4.2 test/log/spec_debug.rb
pione-0.4.1 test/log/spec_debug.rb
pione-0.4.0 test/log/spec_debug.rb