1 require File.dirname(__FILE__) + '/../../../spec_helper'
2 require File.dirname(__FILE__) + '/../fixtures/common'
4 describe "Logger::Application#start" do
6 @file_path = tmp("test_log.log")
7 @log_file = File.open(@file_path, "w+")
8 @app = LoggerSpecs::TestApp.new("TestApp", @log_file)
12 File.unlink(@file_path) if File.exists?(@file_path)
16 it "starts the application logging start/end messages" do
19 app_start, discard, app_end = @log_file.readlines
20 LoggerSpecs::strip_date(app_start).should == "INFO -- TestApp: Start of TestApp.\n"
21 LoggerSpecs::strip_date(app_end).should == "INFO -- TestApp: End of TestApp. (status: true)\n"
24 it "returns the status code" do
27 app_end = @log_file.readlines.last
28 /true/.should =~ LoggerSpecs::strip_date(app_end)