spec/stack/deployment/status_spec.rb in simple_deploy-0.7.2 vs spec/stack/deployment/status_spec.rb in simple_deploy-0.7.3
- old
+ new
@@ -1,20 +1,18 @@
require 'spec_helper'
-describe SimpleDeploy do
+describe SimpleDeploy::Stack::Deployment::Status do
+ include_context 'stubbed config'
+ include_context 'double stubbed logger'
+ include_context 'stubbed stack', :name => 'my_stack',
+ :environment => 'my_env'
before do
- @logger_stub = stub 'logger', :debug => true,
- :info => true
- @config_mock = mock 'config'
- @config_mock.stub :logger => @logger_stub
- @stack_mock = mock 'stack'
-
- options = { :config => @config_mock,
- :stack => @stack_mock,
+ options = { :stack => @stack_mock,
:ssh_user => 'user',
:name => 'dastack' }
+
@status = SimpleDeploy::Stack::Deployment::Status.new options
end
describe "clear_for_deployment?" do
it "should return true if clear for deployment" do
@@ -41,12 +39,13 @@
end
describe "clear_deployment_lock" do
it "should unset deploy in progress if force & deploy in progress" do
@stack_mock.stub :attributes => { 'deployment_in_progress' => 'true' }
- @stack_mock.should_receive(:update).
- with( { :attributes => [ { 'deployment_in_progress' => 'false'} ] })
+ @stack_mock.should_receive(:in_progress_update).
+ with( { :attributes => [ { 'deployment_in_progress' => 'false' } ],
+ :caller => @status })
@status.clear_deployment_lock(true)
end
end
describe "set_deployment_in_prgoress" do
@@ -58,11 +57,12 @@
end
end
describe "unset_deployment_in_prgoress" do
it "clears deployment in progress" do
- @stack_mock.should_receive(:update).
- with( { :attributes => [ { 'deployment_in_progress' => 'false'} ] })
+ @stack_mock.should_receive(:in_progress_update).
+ with( { :attributes => [ { 'deployment_in_progress' => 'false'} ],
+ :caller => @status })
@status.unset_deployment_in_progress
end
end
end