Permalink
Browse files

Add check for ActionMailer (closes #66)

Check that ActionMailer is loaded before using the code for it.
  • Loading branch information...
1 parent 682e5c7 commit a8ea722036ab5edde27a7aab47a2b7c543cf279e @terrcin terrcin committed with Jul 19, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/minitest/rails.rb
View
@@ -5,7 +5,7 @@
require "minitest/rails/active_support"
require "minitest/rails/action_controller"
require "minitest/rails/action_view"
-require "minitest/rails/action_mailer"
+require "minitest/rails/action_mailer" if defined? ActionMailer
require "minitest/rails/action_dispatch"
# Enable turn if it is available
@@ -21,7 +21,7 @@ def self.override_testunit!
::ActiveSupport.const_set :TestCase, MiniTest::Rails::ActiveSupport::TestCase
::ActionController.const_set :TestCase, MiniTest::Rails::ActionController::TestCase
::ActionView.const_set :TestCase, MiniTest::Rails::ActionView::TestCase
- ::ActionMailer.const_set :TestCase, MiniTest::Rails::ActionMailer::TestCase
+ ::ActionMailer.const_set :TestCase, MiniTest::Rails::ActionMailer::TestCase if defined? ActionMailer
::ActionDispatch.const_set :IntegrationTest, MiniTest::Rails::ActionDispatch::IntegrationTest
end
end

0 comments on commit a8ea722

Please sign in to comment.