Sha256: db7b2bfb93c5ac46b3f7620f348a34b87fb6923e73dfda1e63f1556c8124fb6f

Contents?: true

Size: 1023 Bytes

Versions: 13

Compression:

Stored size: 1023 Bytes

Contents

describe "Prime.env" do

  before do 
    @logger = Prime::Logger.new
    @logger.stub!(:output) do |message|
      message
    end
  end

  it 'should work' do
    @logger.log("Hello world").should == 'Hello world'
  end

  describe "error level" do
    before { Prime::Logger.level = :error }

    it 'should log errors' do
      @logger.error("message").should == ["message"]
    end

    it 'should not log info' do
      @logger.info("message").should == nil
    end
  end

  describe "info level" do
    before { Prime::Logger.level = :info }

    it 'should log info' do
      @logger.info("message").should == ["message"]
    end

    it 'should not log debug' do
      @logger.debug("message").should == nil
    end
  end

  describe "debug level" do
    before { Prime::Logger.level = :debug }

    it 'should log debug' do
      @logger.debug("message").should == ["message"]
    end

    it 'should not log dealloc' do
      @logger.dealloc_message("message", Prime::Section.new).should == nil
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
motion-prime-1.0.7 spec/unit/prime/logger.rb
motion-prime-1.0.6 spec/unit/prime/logger.rb
motion-prime-1.0.5 spec/unit/prime/logger.rb
motion-prime-1.0.4 spec/unit/prime/logger.rb
motion-prime-1.0.3 spec/unit/prime/logger.rb
motion-prime-1.0.2 spec/unit/prime/logger.rb
motion-prime-1.0.1 spec/unit/prime/logger.rb
motion-prime-1.0.0 spec/unit/prime/logger.rb
motion-prime-0.9.9.2 spec/unit/prime/logger.rb
motion-prime-0.9.9.1 spec/unit/prime/logger.rb
motion-prime-0.9.9 spec/unit/prime/logger.rb
motion-prime-0.9.8 spec/unit/prime/logger.rb
motion-prime-0.9.7 spec/unit/prime/logger.rb