Skip to content

Instantly share code, notes, and snippets.

@threez
Last active December 20, 2015 16:09
Show Gist options
  • Save threez/6159543 to your computer and use it in GitHub Desktop.
Save threez/6159543 to your computer and use it in GitHub Desktop.
Simple rspec prototype on how to test exim with rspec
require 'spec_helper'
describe 'Exim Config' do
let!(:exim) { exim_server(config) }
context 'simple config' do
let!(:relay) { mail_server(:y) }
let(:config) { exim_config(:simple) }
let(:mail_x) { mail_fixture(:mail_x) }
it 'should deliver mail x to other mail server y' do
exim.send_mail mail_x
relay.should have_received(mail_x)
mail_x.should be_dropped_by(:rule2)
end
it 'should deliver mail x to other mail server y' do
exim.send_mail mail_c
relay.has_not_received mail_c
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment