Last active
December 21, 2015 15:29
-
-
Save dchelimsky/6327095 to your computer and use it in GitHub Desktop.
Another approach to spec'ing message expectations without caring about return values, as described in http://tatey.com/2013/08/24/dont-care-about-the-return-value-of-outgoing-commands/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe Task::RestartProcesses do | |
describe '#run_with_error' do | |
let(:client) { double('HerokuClient').as_null_object } | |
let(:logger) { double('Logger').as_null_ojbect } | |
let(:task) { Task::RestartProcesses.new logger: logger } | |
before do | |
# Inject Dependencies | |
task.client = client | |
# Run | |
task.run_with_error | |
end | |
it 'restarts processes' do | |
expect(client).to have_received(:post_ps_restart) | |
end | |
it 'logs' do | |
expect(logger).to have_received(:info).with('Restarting processes') | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment