-
-
Save nakajima/3c55cbec990f283c5399 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'acts_as_fu' | |
require 'spec' | |
describe "custom logger" do | |
def logger | |
ActiveRecord::Base.logger | |
end | |
before(:each) do | |
ActiveRecord::Base.logger.formatter = SyslogFormatter.new | |
ActiveRecord::Base.logger.level = Logger::INFO # DEBUG, WARN, ERROR, FATAL | |
ActsAsFu.log.clear | |
end | |
it "should be formatted properly" do | |
full_example_description = "#{self.class.description} #{@method_name}" | |
logger.info("\n\n#{full_example_description}\n#{'-' * (full_example_description.length)}") | |
ActsAsFu.log.should == "#{l_time} #{l_host} #{l_process} #{l_text} #{l_user}\n" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment