diff options
author | Nitz <nitz.raz@gmail.com> | 2015-03-31 18:12:35 +0300 |
---|---|---|
committer | Nitz <nitz.raz@gmail.com> | 2015-08-18 16:27:43 +0300 |
commit | c93f286bb7c187522a1294ea8e52a5aa04273162 (patch) | |
tree | 305580570d095556404ee66b12041b0ffbd1a3e0 /spec/unit/provider/deploy_spec.rb | |
parent | bacb2ff93ccc2e14a0b721988e241a1d07f70795 (diff) | |
download | chef-c93f286bb7c187522a1294ea8e52a5aa04273162.tar.gz |
Migrated deploy resource to use shell_out instead of run_command
Should help with troubleshooting failed migrations
Diffstat (limited to 'spec/unit/provider/deploy_spec.rb')
-rw-r--r-- | spec/unit/provider/deploy_spec.rb | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/spec/unit/provider/deploy_spec.rb b/spec/unit/provider/deploy_spec.rb index f6bb78823f..e6a7125e32 100644 --- a/spec/unit/provider/deploy_spec.rb +++ b/spec/unit/provider/deploy_spec.rb @@ -362,7 +362,7 @@ describe Chef::Provider::Deploy do it "skips the migration when resource.migrate => false but runs symlinks before migration" do @resource.migrate false - expect(@provider).not_to receive :run_command + expect(@provider).not_to receive :shell_out! expect(@provider).to receive :run_symlinks_before_migrate @provider.migrate end @@ -378,7 +378,7 @@ describe Chef::Provider::Deploy do allow(STDOUT).to receive(:tty?).and_return(true) allow(Chef::Log).to receive(:info?).and_return(true) - expect(@provider).to receive(:run_command).with(:command => "migration_foo", :cwd => @expected_release_dir, + expect(@provider).to receive(:shell_out!).with("migration_foo",:cwd => @expected_release_dir, :user => "deployNinja", :group => "deployNinjas", :log_level => :info, :live_stream => STDOUT, :log_tag => "deploy[/my/deploy/dir]", @@ -445,13 +445,13 @@ describe Chef::Provider::Deploy do end it "does nothing for restart if restart_command is empty" do - expect(@provider).not_to receive(:run_command) + expect(@provider).not_to receive(:shell_out!) @provider.restart end it "runs the restart command in the current application dir when the resource has a restart_command" do @resource.restart_command "restartcmd" - expect(@provider).to receive(:run_command).with(:command => "restartcmd", :cwd => "/my/deploy/dir/current", :log_tag => "deploy[/my/deploy/dir]", :log_level => :debug) + expect(@provider).to receive(:shell_out!).with("restartcmd", :cwd => "/my/deploy/dir/current", :log_tag => "deploy[/my/deploy/dir]", :log_level => :debug) @provider.restart end @@ -509,7 +509,7 @@ describe Chef::Provider::Deploy do it "shouldn't give a no method error on migrate if the environment is nil" do allow(@provider).to receive(:enforce_ownership) allow(@provider).to receive(:run_symlinks_before_migrate) - allow(@provider).to receive(:run_command) + allow(@provider).to receive(:shell_out!) @provider.migrate end |