Sha256: dc79154f1b257b7e1edd5c838aa0e0e488d6ecf4bde0e20dfee78d1705d21397

Contents?: true

Size: 555 Bytes

Versions: 3

Compression:

Stored size: 555 Bytes

Contents

require File.expand_path('../../fixtures/common', __FILE__)

describe "Logger::Application#set_log"do
  before :each do
    @file_path = tmp("test_log.log")
    @log_file = File.open(@file_path, "w+")
    @app = LoggerSpecs::TestApp.new("TestApp", @log_file)
  end

  after :each do
    @log_file.close unless @log_file.closed?
    rm_r @file_path
  end

  it "sets the log device for the logger" do
    regex = /STDERR Message/
    @app.set_log(STDERR)
    lambda { @app.log(Logger::WARN, "STDERR Message") }.should output_to_fd(regex, STDERR)
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rubysl-logger-2.1.0 spec/application/set_log_spec.rb
rubysl-logger-1.0.0 spec/application/set_log_spec.rb
rubysl-logger-2.0.0 spec/application/set_log_spec.rb