You had said previously that 'should_receive' s  are treated a little differently and we cant get around the duplication in this case.

From: Brett Weaver [mailto:notifications@github.com]
Sent: Monday, February 18, 2013 8:16 PM
To: intuit/simple_deploy
Cc: Young, Kevin
Subject: Re: [simple_deploy] To address issue 149,150 and 155 for simple deploy, Capistrano error handling (#154)


In spec/stack/ssh_spec.rb:

>          Capistrano::Configuration.should_receive(:new).

>                                    with(:output => @logger_stub).

>                                    and_return @task_mock

> -        @task_mock.stub :logger    => task_logger_mock,

> -                        :variables => @ssh_options

> -        task_logger_mock.should_receive(:level=).with(3)

> +

> +        @task_logger_mock.should_receive(:level=).with(3)

>          @task_mock.should_receive(:set).with :user, 'user'

>          @task_mock.should_receive(:server).with('1.2.3.4', :instances)

>          @task_mock.should_receive(:server).with('4.3.2.1', :instances)

these 4 should receives appear to be the same across the file. They can probably be moved into the first before block to cut down on duplication.

—
Reply to this email directly or view it on GitHub<https://github.com/intuit/simple_deploy/pull/154/files#r3056959>.