Sha256: 5342095d4f99f407e20460cf7f60f9361fc7bbef0bffd5b91c54362424ebda2b

Contents?: true

Size: 736 Bytes

Versions: 12

Compression:

Stored size: 736 Bytes

Contents

require File.expand_path("#{File.dirname(__FILE__)}/../spec_helper")

describe ActiveWrapper::Log do
  
  before(:each) do
    FileUtils.rm_f(@path = SPEC + "/example_project/log/test.log")
    $db, $log, $mail = ActiveWrapper.setup(
      :base => SPEC + '/example_project',
      :env => 'test'
    )
  end
  
  it "should create a log file" do
    File.exists?(@path).should == true
  end
  
  it "should log to the log file" do
    $log.info "test"
    File.read(@path).include?('test').should == true
  end
  
  it "should clear the log file while keeping the logger intact" do
    $log.clear
    File.read(@path).include?('test').should == false
    $log.info "test"
    File.read(@path).include?('test').should == true
  end
end

Version data entries

12 entries across 12 versions & 2 rubygems

Version Path
winton-active_wrapper-0.1.7 spec/active_wrapper/log_spec.rb
winton-active_wrapper-0.1.8 spec/active_wrapper/log_spec.rb
winton-active_wrapper-0.1.9 spec/active_wrapper/log_spec.rb
winton-active_wrapper-0.2.0 spec/active_wrapper/log_spec.rb
active_wrapper-0.2.7 spec/active_wrapper/log_spec.rb
active_wrapper-0.2.6 spec/active_wrapper/log_spec.rb
active_wrapper-0.2.5 spec/active_wrapper/log_spec.rb
active_wrapper-0.2.4 spec/active_wrapper/log_spec.rb
active_wrapper-0.2.3 spec/active_wrapper/log_spec.rb
active_wrapper-0.2.2 spec/active_wrapper/log_spec.rb
active_wrapper-0.2.1 spec/active_wrapper/log_spec.rb
active_wrapper-0.2.0 spec/active_wrapper/log_spec.rb