Skip to content
Browse files

Fix test name and add the right require

  • Loading branch information...
1 parent 2aed3e2 commit d0c8d7b5a3cc276eeee8c5db82d2e475bc1599e9 @joshuaclayton joshuaclayton committed
Showing with 13 additions and 1 deletion.
  1. +13 −1 test/rails_init_test.rb
View
14 test/rails_init_test.rb
@@ -1,6 +1,7 @@
require File.dirname(__FILE__) + '/helper'
+require File.join(File.dirname(__FILE__), '..', 'lib', 'hoptoad_notifier', 'rails_init')
-class RailsTest < Test::Unit::TestCase
+class RailsInitTest < Test::Unit::TestCase
include DefinesConstants
should "trigger use of Rails' logger if logger isn't set and Rails' logger exists" do
@@ -20,4 +21,15 @@ def self.logger
HoptoadNotifier::RailsInit.new
assert_equal "RAILS DEFAULT LOGGER", HoptoadNotifier.logger
end
+
+ should "allow overriding of the logger if already assigned" do
+ define_constant("RAILS_DEFAULT_LOGGER", "RAILS DEFAULT LOGGER")
+ HoptoadNotifier::RailsInit.new
+
+ HoptoadNotifier.configure(true) do |config|
+ config.logger = "OVERRIDDEN LOGGER"
+ end
+
+ assert_equal "OVERRIDDEN LOGGER", HoptoadNotifier.logger
+ end
end

0 comments on commit d0c8d7b

Please sign in to comment.
Something went wrong with that request. Please try again.