Sha256: 7be5fc3a17a793878ad83c34c4caa4434a0f1556effb4a379b6352b5e98e8c81
Contents?: true
Size: 1.67 KB
Versions: 1
Compression:
Stored size: 1.67 KB
Contents
require 'spec_helper' describe "Pancake configuration defaults" do describe "logging defaults" do before do Pancake.root = Pancake.get_root(__FILE__) end after do Pancake.reset_configuration FileUtils.rm_rf(File.join(Pancake.root, "log")) end it "should set the log path" do path = Pancake.configuration.log_path path.should == "log/pancake_#{Pancake.env}.log" end it "should set the log level to :info" do Pancake.configuration.log_level.should == :info end it "should set the delimiter to ~ " do Pancake.configuration.log_delimiter.should == " ~ " end it "should set auto flush to true" do Pancake.configuration.log_auto_flush.should be_true end it "should set log to file to false" do Pancake.configuration.log_to_file.should be_false end it "should set log to file to true if env is production" do Pancake.stub(:env).and_return("production") Pancake.configuration.log_to_file.should be_true end it "should set the log_stream to STDOUT by default" do Pancake.configuration.log_stream.should === STDOUT end it "should set the log stream to a file path when told to log to file" do Pancake.configuration.log_to_file = true result = Pancake.configuration.log_path result.should match(/\log\/pancake_#{Pancake.env}\.log$/) end it "should create the directory if it doesn't exist" do File.exists?(File.join(Pancake.root, "log")).should be_false Pancake.configuration.log_to_file = true Pancake.configuration.log_stream File.exists?(File.join(Pancake.root, "log")).should be_true end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
pancake-0.3.0 | spec/pancake/defaults/configuration_spec.rb |