Sha256: 172d3fcb12237b5dba7a8aa5c4b9b7e4c29b8dbcf80365f480b3652e7a517826

Contents?: true

Size: 861 Bytes

Versions: 4

Compression:

Stored size: 861 Bytes

Contents

require 'spec_helper'

module WebsocketRails
  class ClassWithLogging
    include Logging
  end

  describe ClassWithLogging do

    describe "#log" do
      context "when log_level = :warn" do
        before do
          WebsocketRails.setup do |config|
            config.log_level = :warn
          end
        end

        it "should not print to the console" do
          subject.should_not_receive(:puts).with("test message")
          subject.log "test message"
        end
      end

      context "log_level = :debug" do
        before do
          WebsocketRails.setup do |config|
            config.log_level = :debug
          end
        end

        it "should print to the console if log_level is :debug" do
          subject.should_receive(:puts).with("test message")
          subject.log "test message"
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
websocket-rails-0.3.0 spec/unit/logging_spec.rb
websocket-rails-0.2.1 spec/unit/logging_spec.rb
websocket-rails-0.2.0 spec/unit/logging_spec.rb
websocket-rails-0.1.9 spec/unit/logging_spec.rb