Skip to content

Instantly share code, notes, and snippets.

@jfredett
Last active December 14, 2015 13:19
Show Gist options
  • Select an option

  • Save jfredett/5092826 to your computer and use it in GitHub Desktop.

Select an option

Save jfredett/5092826 to your computer and use it in GitHub Desktop.
require 'spec_helper'
describe QuitCommand do
let(:terminal) { double('terminal', shutdown: true ) }
let(:command) { QuitCommand.new terminal }
context do
subject{ command }
it_behaves_like "a command"
end
context do
subject { terminal }
before { command.execute }
it { should have_received :shutdown }
end
end
@jfredett
Copy link
Author

jfredett commented Mar 5, 2013

require 'spec_helper'

describe QuitCommand do


  let(:terminal) { double('terminal', shutdown: true ) }
  subject { QuitCommand.new terminal }

  before { command.execute }

  it_behaves_like "a command"

  #with the 'the' helper I linked.
  the(:terminal) { should have_received :shutdown }


end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment