rspec-spies is a nice gem for this sort of mocking, makes the setup/teardown a bit nicer. Also look into using `lets` and `befores` to do some of the lifting, w/ rspec-spies, it'd look like:


    subject(:terminal) { double('terminal', shutdown: true) }

    let(:command) { QuitCommand.new terminal }
    before { command.execute }
    
    it { should have_received :shutdown }