2010-05-07 18:09:57 +00:00
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
describe Apache::Config, "logging directives" do
|
|
|
|
let(:apache) { Apache::Config }
|
|
|
|
before { apache.reset! }
|
|
|
|
|
|
|
|
it "should handle a defined log type" do
|
|
|
|
apache.rotate_logs_path = '/path/to/rotatelogs'
|
|
|
|
|
|
|
|
[ :custom, :error, :script, :rewrite ].each do |type|
|
|
|
|
apache.reset!
|
|
|
|
apache.send("#{type}_log".to_sym, 'test', 'test2')
|
|
|
|
apache.to_a.should == [ %{#{type.to_s.capitalize}Log "test" test2} ]
|
2011-09-27 19:58:42 +00:00
|
|
|
Apache::Logging.log_paths[type].should == [ "test" ]
|
2010-05-07 18:09:57 +00:00
|
|
|
|
|
|
|
apache.reset!
|
|
|
|
apache.send("rotate_#{type}_log".to_sym, 'test', 86400, 'test2')
|
|
|
|
apache.to_a.should == [ %{#{type.to_s.capitalize}Log "|/path/to/rotatelogs test 86400" test2} ]
|
2011-09-27 19:58:42 +00:00
|
|
|
Apache::Logging.log_paths[type].should == [ "test" ]
|
2010-05-07 18:09:57 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
it "should give log formats" do
|
|
|
|
apache.combined_log_format
|
|
|
|
apache.common_log_format
|
|
|
|
end
|
|
|
|
end
|