Sha256: c476a2d1e3e0333ffa33efb747d3ed024a89f8f2c81438b6f3b2c4583bf4ff64

Contents?: true

Size: 882 Bytes

Versions: 8

Compression:

Stored size: 882 Bytes

Contents

require "spec_helper"

describe Logger do
  context "playtime" do
    it "should log stuff" do
      logger = Logger.new(STDOUT)
      logger.level = Logger::DEBUG

      #logger.debug("i am logged")
      #logger.close
    end
  end
end

module Nasty
  describe Log do
    context "when logging stuff" do
      let(:logger) { double("", debug: true) }
      let(:log_factory) { double }

      before :each do
        log_factory.stub(:create_for).with(self).and_return(logger)
        Log.bind_to(log_factory)
        Log.for(self).debug("hi there")
      end

      after :each do
        Log.unbind
      end

      it "should log to the bound logger" do
        logger.should have_received(:debug).with("hi there")
      end
    end

    context "logger" do
      it "should be able to call the logger from anywhere" do
        logger.debug("blah")
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
nasty-0.0.1395464273 spec/unit/log_spec.rb
nasty-0.0.1388168019 spec/unit/log_spec.rb
nasty-0.0.1388167257 spec/unit/log_spec.rb
nasty-0.0.1388166944 spec/unit/log_spec.rb
nasty-0.0.1388166636 spec/unit/log_spec.rb
nasty-0.0.1388165564 spec/unit/log_spec.rb
nasty-0.0.1388164945 spec/unit/log_spec.rb
nasty-0.0.1388164765 spec/unit/log_spec.rb