spec/cli/attributes_spec.rb in simple_deploy-0.7.2 vs spec/cli/attributes_spec.rb in simple_deploy-0.7.3

- old
+ new

@@ -1,29 +1,19 @@ require 'spec_helper' require 'simple_deploy/cli' describe SimpleDeploy::CLI::Attributes do + include_context 'cli config' + include_context 'double stubbed logger' + include_context 'double stubbed stack', :name => 'my_stack', + :environment => 'my_env' describe 'show' do before do - @config = mock 'config' - @logger = stub 'logger' @options = { :environment => 'my_env', :log_level => 'debug', :name => 'my_stack' } - @stack = stub :attributes => { 'foo' => 'bar', 'baz' => 'blah' } - - SimpleDeploy::Config.stub(:new).and_return(@config) - @config.should_receive(:environment).with('my_env').and_return(@config) - SimpleDeploy::SimpleDeployLogger.should_receive(:new). - with(:log_level => 'debug'). - and_return(@logger) - SimpleDeploy::Stack.should_receive(:new). - with(:config => @config, - :environment => 'my_env', - :logger => @logger, - :name => 'my_stack'). - and_return(@stack) + @stack_stub.stub(:attributes).and_return({ 'foo' => 'bar', 'baz' => 'blah' }) end it 'should output the attributes' do subject.should_receive(:valid_options?). with(:provided => @options,