diff options
Diffstat (limited to 'actionmailer/test')
-rw-r--r-- | actionmailer/test/abstract_unit.rb | 12 | ||||
-rw-r--r-- | actionmailer/test/mail_service_test.rb | 5 |
2 files changed, 5 insertions, 12 deletions
diff --git a/actionmailer/test/abstract_unit.rb b/actionmailer/test/abstract_unit.rb index a6126d6f7f..51b375fef3 100644 --- a/actionmailer/test/abstract_unit.rb +++ b/actionmailer/test/abstract_unit.rb @@ -1,5 +1,9 @@ +require 'rubygems' require 'test/unit' +gem 'mocha', '>= 0.9.5' +require 'mocha' + $:.unshift "#{File.dirname(__FILE__)}/../lib" $:.unshift "#{File.dirname(__FILE__)}/../../activesupport/lib" $:.unshift "#{File.dirname(__FILE__)}/../../actionpack/lib" @@ -43,7 +47,6 @@ class Net::SMTP end def uses_gem(gem_name, test_name, version = '> 0') - require 'rubygems' gem gem_name.to_s, version require gem_name.to_s yield @@ -51,13 +54,6 @@ rescue LoadError $stderr.puts "Skipping #{test_name} tests. `gem install #{gem_name}` and try again." end -# Wrap tests that use Mocha and skip if unavailable. -unless defined? uses_mocha - def uses_mocha(test_name, &block) - uses_gem('mocha', test_name, '>= 0.5.5', &block) - end -end - def set_delivery_method(delivery_method) @old_delivery_method = ActionMailer::Base.delivery_method ActionMailer::Base.delivery_method = delivery_method diff --git a/actionmailer/test/mail_service_test.rb b/actionmailer/test/mail_service_test.rb index a886b1143e..1e04531753 100644 --- a/actionmailer/test/mail_service_test.rb +++ b/actionmailer/test/mail_service_test.rb @@ -289,8 +289,6 @@ class TestMailer < ActionMailer::Base end end -uses_mocha 'ActionMailerTest' do - class ActionMailerTest < Test::Unit::TestCase include ActionMailer::Quoting @@ -940,6 +938,7 @@ EOF ActionMailer::Base.delivery_method = :smtp TestMailer.deliver_return_path assert_match %r{^Return-Path: <another@somewhere.test>}, MockSMTP.deliveries[0][0] + assert_equal "another@somewhere.test", MockSMTP.deliveries[0][1].to_s end def test_body_is_stored_as_an_ivar @@ -974,8 +973,6 @@ EOF end end -end # uses_mocha - class InheritableTemplateRootTest < Test::Unit::TestCase def test_attr expected = "#{File.dirname(__FILE__)}/fixtures/path.with.dots" |