From bd96614101262e0ad0cc176ed8e2d95a5c17936b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim=20and=20Mikel=20Lindsaar?= Date: Sun, 24 Jan 2010 19:36:42 +0100 Subject: Move old tests to a specific folder and add some delivery method tests. --- actionmailer/test/abstract_unit.rb | 24 +++++------------------- 1 file changed, 5 insertions(+), 19 deletions(-) (limited to 'actionmailer/test/abstract_unit.rb') diff --git a/actionmailer/test/abstract_unit.rb b/actionmailer/test/abstract_unit.rb index 1fc5ab85e0..781e49ae05 100644 --- a/actionmailer/test/abstract_unit.rb +++ b/actionmailer/test/abstract_unit.rb @@ -8,7 +8,6 @@ $:.unshift(lib) unless $:.include?('lib') || $:.include?(lib) require 'rubygems' require 'test/unit' - require 'action_mailer' # Show backtraces for deprecated behavior for quicker cleanup. @@ -18,15 +17,11 @@ ActiveSupport::Deprecation.debug = true ActionView::Template.register_template_handler :haml, lambda { |template| "Look its HAML!".inspect } ActionView::Template.register_template_handler :bak, lambda { |template| "Lame backup".inspect } -ActionView::Base::DEFAULT_CONFIG = { :assets_dir => '/nowhere' } - -$:.unshift "#{File.dirname(__FILE__)}/fixtures/helpers" +FIXTURE_LOAD_PATH = File.expand_path('fixtures', File.dirname(__FILE__)) +ActionMailer::Base.view_paths = FIXTURE_LOAD_PATH +$:.unshift File.join(FIXTURE_LOAD_PATH, 'helpers') -FIXTURE_LOAD_PATH = File.join(File.dirname(__FILE__), 'fixtures') -ActionMailer::Base.template_root = FIXTURE_LOAD_PATH - -class MockSMTP - +class MockSMTP def self.deliveries @@deliveries end @@ -42,7 +37,6 @@ class MockSMTP def start(*args) yield self end - end class Net::SMTP @@ -51,14 +45,6 @@ class Net::SMTP end end -def uses_gem(gem_name, test_name, version = '> 0') - gem gem_name.to_s, version - require gem_name.to_s - yield -rescue LoadError - $stderr.puts "Skipping #{test_name} tests. `gem install #{gem_name}` and try again." -end - def set_delivery_method(method) @old_delivery_method = ActionMailer::Base.delivery_method ActionMailer::Base.delivery_method = method @@ -66,4 +52,4 @@ end def restore_delivery_method ActionMailer::Base.delivery_method = @old_delivery_method -end +end \ No newline at end of file -- cgit v1.2.3