# RSpec Mail Matchers These are some RSpec matchers to be used with the [Mail gem](https://github.com/mikel/mail). The mail gem allready includes some rspec matchers but these are for if you want to use the expect syntax in your specs. You can make assertions against a specific Mail::Message, but there is no functionality for finding the message for you like the included matchers. ## Installation Add this line to your application's Gemfile in the test group: gem 'rspec-mail-matchers' And then execute: $ bundle ## Usage ```ruby describe 'sending an email' do end ``` Mail.defaults do delivery_method :test # in practice you'd do this in spec_helper.rb end describe "sending an email" do before(:each) do Mail::TestMailer.deliveries.clear Mail.deliver do to ['ed@reevoo.com', 'foo@bar.com'] from 'test@example.com' subject 'testing' text_part do body 'This is plain text' end html_part do content_type 'text/html; charset=UTF-8' body '