spec/tartarus_spec.rb in tartarus-1.0.3 vs spec/tartarus_spec.rb in tartarus-2.0.0
- old
+ new
@@ -1,12 +1,8 @@
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
describe Tartarus do
- it 'should include rescue module into ActionController::Base if a rails enviroment is loaded' do
- ActionController::Base.included_modules.include?(Tartarus::Rescue).should be_true
- end
-
describe "#logger_class" do
it 'should return the registered loggers class from the configuration' do
Tartarus.should_receive(:configuration).and_return({ 'logger_class' => 'LoggedException' })
Tartarus.logger_class.should == LoggedException
end
@@ -25,10 +21,11 @@
end
describe "#log" do
before(:each) do
+ Tartarus.stub!(:configuration).and_return({ 'enabled' => true, :logger_class => 'LoggedException' })
@controller = mock('controller')
@exception = StandardError.new
Tartarus.stub!(:logger_class).and_return(LoggedException)
end
@@ -43,24 +40,24 @@
end
end
describe "#configuration" do
before(:each) do
- YAML.stub!(:load_file).and_return({ 'development' => { 'enabled' => true }, 'test' => { 'enabled' => false } })
+ YAML.stub!(:load_file).and_return({ 'test' => { 'enabled' => true } })
end
- it 'should parse the YAML configuration file for exceptional' do
+ it 'should parse the YAML configuration file' do
YAML.should_receive(:load_file).with("#{Rails.root}/config/exceptions.yml")
Tartarus.configuration
end
it 'should return the configuration from the current rails enviroment' do
- Tartarus.configuration.should == { 'enabled' => false }
+ Tartarus.configuration.should == { 'enabled' => true }
end
it 'should return a cached config if the configuration has already been loaded before' do
Tartarus.configuration
YAML.should_receive(:load_file).never
- Tartarus.configuration.should == { 'enabled' => false }
+ Tartarus.configuration.should == { 'enabled' => true }
end
end
end