spec/cli/deploy_spec.rb in simple_deploy-0.6.4 vs spec/cli/deploy_spec.rb in simple_deploy-0.6.5

- old
+ new

@@ -20,13 +20,13 @@ :name => ['my_stack'], :force => true, :internal => false, :attributes => [] } - SimpleDeploy::CLI::Shared.should_receive(:valid_options?). - with(:provided => options, - :required => [:environment, :name]) + subject.should_receive(:valid_options?). + with(:provided => options, + :required => [:environment, :name]) Trollop.stub(:options).and_return(options) SimpleDeploy::Notifier.should_receive(:new). with(:stack_name => 'my_stack', :environment => 'my_env', @@ -38,29 +38,29 @@ :logger => @logger, :name => 'my_stack', :internal => false). and_return(@stack) + @stack.should_receive(:wait_for_stable) @stack.should_receive(:deploy).with(true).and_return(true) @notifier.should_receive(:send_deployment_start_message) @notifier.should_receive(:send_deployment_complete_message) subject.deploy end - it "should exit on error with a status of 1" do options = { :environment => 'my_env', :log_level => 'debug', :name => ['my_stack'], :force => true, :internal => false, :attributes => [] } - SimpleDeploy::CLI::Shared.should_receive(:valid_options?). - with(:provided => options, - :required => [:environment, :name]) + subject.should_receive(:valid_options?). + with(:provided => options, + :required => [:environment, :name]) Trollop.stub(:options).and_return(options) SimpleDeploy::Notifier.should_receive(:new). with(:stack_name => 'my_stack', :environment => 'my_env', @@ -72,10 +72,11 @@ :logger => @logger, :name => 'my_stack', :internal => false). and_return(@stack) + @stack.should_receive(:wait_for_stable) @stack.should_receive(:deploy).with(true).and_return(false) @notifier.should_receive(:send_deployment_start_message) begin subject.deploy @@ -90,13 +91,13 @@ :name => ['my_stack'], :force => true, :internal => false, :attributes => ['foo=bah'] } - SimpleDeploy::CLI::Shared.should_receive(:valid_options?). - with(:provided => options, - :required => [:environment, :name]) + subject.should_receive(:valid_options?). + with(:provided => options, + :required => [:environment, :name]) Trollop.stub(:options).and_return(options) SimpleDeploy::Notifier.should_receive(:new). with(:stack_name => 'my_stack', :environment => 'my_env', @@ -109,10 +110,11 @@ :name => 'my_stack', :internal => false). and_return(@stack) @stack.should_receive(:update).with(hash_including(:force => true, :attributes => [{'foo' => 'bah'}])).and_return(true) + @stack.should_receive(:wait_for_stable) @stack.should_receive(:deploy).with(true).and_return(true) @notifier.should_receive(:send_deployment_start_message) @notifier.should_receive(:send_deployment_complete_message) subject.deploy @@ -124,13 +126,13 @@ :name => ['my_stack'], :force => true, :internal => false, :attributes => ['foo=bah'] } - SimpleDeploy::CLI::Shared.should_receive(:valid_options?). - with(:provided => options, - :required => [:environment, :name]) + subject.should_receive(:valid_options?). + with(:provided => options, + :required => [:environment, :name]) Trollop.stub(:options).and_return(options) SimpleDeploy::Notifier.should_receive(:new). with(:stack_name => 'my_stack', :environment => 'my_env', @@ -144,10 +146,11 @@ :internal => false). and_return(@stack) @stack.should_receive(:update).with(hash_including(:force => true, :attributes => [{'foo' => 'bah'}])).and_return(false) + @stack.should_receive(:wait_for_stable) begin subject.deploy rescue SystemExit => e e.status.should == 1 @@ -160,13 +163,13 @@ :name => ['my_stack'], :force => true, :internal => false, :attributes => [] } - SimpleDeploy::CLI::Shared.should_receive(:valid_options?). - with(:provided => options, - :required => [:environment, :name]) + subject.should_receive(:valid_options?). + with(:provided => options, + :required => [:environment, :name]) Trollop.stub(:options).and_return(options) SimpleDeploy::Notifier.should_receive(:new). with(:stack_name => 'my_stack', :environment => 'my_env', @@ -179,9 +182,10 @@ :name => 'my_stack', :internal => false). and_return(@stack) @stack.should_not_receive(:update) + @stack.should_receive(:wait_for_stable) @stack.should_receive(:deploy).with(true).and_return(true) @notifier.should_receive(:send_deployment_start_message) @notifier.should_receive(:send_deployment_complete_message) subject.deploy