Permalink
Browse files

Updated tests for RSpec v2.

  • Loading branch information...
1 parent 0e21ccb commit 3a8f6b30738d6320e5fd586b4e356c8f53b323bc @CodeMonkeySteve CodeMonkeySteve committed Oct 13, 2010
Showing with 7 additions and 13 deletions.
  1. +1 −0 autotest/discover.rb
  2. +3 −3 spec/mailer_spec.rb
  3. +1 −3 spec/mailers/test_mailer.rb
  4. +0 −2 spec/spec.opts
  5. +2 −5 spec/spec_helper.rb
@@ -0,0 +1 @@
+Autotest.add_discovery { 'rspec2' }
View
@@ -12,9 +12,9 @@ def deliver_message(message_name, *args)
end
end
- def have_addresses(*addresses)
- simple_matcher("have addresses #{addresses.inspect}") do |array|
- array.to_a.sort == addresses
+ RSpec::Matchers.define :have_addresses do |expected|
+ match do |actual|
+ actual.to_a.include? expected
end
end
@@ -1,8 +1,6 @@
class TestMailer < ActionMailer::Base
# template root must be set for multipart emails, or ActionMailer will throw an exception.
- if ActionMailer::VERSION::MAJOR > 2
- view_paths.unshift File.dirname(__FILE__)
- else
+ if ActionMailer::VERSION::MAJOR == 2
self.template_root = File.dirname(__FILE__)
end
View
@@ -1,2 +0,0 @@
---color
---format nested
View
@@ -1,6 +1,6 @@
-require 'spec'
-require 'spec/autorun'
+require 'rspec'
require 'rubygems'
+
$LOAD_PATH << File.join(File.dirname(__FILE__), *%w[.. vendor ginger lib])
require 'ginger'
require 'mail_safe'
@@ -15,6 +15,3 @@
end
ActionMailer::Base.delivery_method = :test
-
-Spec::Runner.configure do |config|
-end

0 comments on commit 3a8f6b3

Please sign in to comment.