Skip to content

Commit

Permalink
Fix test name and add the right require
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuaclayton committed Jan 15, 2010
1 parent 2aed3e2 commit d0c8d7b
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion test/rails_init_test.rb
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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.