summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2014-09-03 12:38:46 -0700
committerLamont Granquist <lamont@scriptkiddie.org>2014-09-08 11:10:05 -0700
commitb36f64f6058b63219e18daadddb9ce02181ed0d2 (patch)
treeebf3c05f1faa6b5907ea223aad76bf43d09cfd5d
parent4e800698f69e8d3e93fb17c6f28da574be62a026 (diff)
downloadchef-b36f64f6058b63219e18daadddb9ce02181ed0d2.tar.gz
spec and code fixes for subversion provider
-rw-r--r--lib/chef/provider/subversion.rb6
-rw-r--r--spec/unit/provider/subversion_spec.rb11
2 files changed, 8 insertions, 9 deletions
diff --git a/lib/chef/provider/subversion.rb b/lib/chef/provider/subversion.rb
index 15f358f126..6cf31c8ec8 100644
--- a/lib/chef/provider/subversion.rb
+++ b/lib/chef/provider/subversion.rb
@@ -60,7 +60,7 @@ class Chef
def action_checkout
if target_dir_non_existent_or_empty?
converge_by("perform checkout of #{@new_resource.repository} into #{@new_resource.destination}") do
- shell_out!(checkout_command)
+ shell_out!(run_options(command: checkout_command))
end
else
Chef::Log.debug "#{@new_resource} checkout destination #{@new_resource.destination} already exists or is a non-empty directory - nothing to do"
@@ -77,7 +77,7 @@ class Chef
def action_force_export
converge_by("export #{@new_resource.repository} into #{@new_resource.destination}") do
- shell_out!(export_command)
+ shell_out!(run_options(command: export_command))
end
end
@@ -88,7 +88,7 @@ class Chef
Chef::Log.debug "#{@new_resource} current revision: #{current_rev} target revision: #{revision_int}"
unless current_revision_matches_target_revision?
converge_by("sync #{@new_resource.destination} from #{@new_resource.repository}") do
- shell_out!(sync_command)
+ shell_out!(run_options(command: sync_command))
Chef::Log.info "#{@new_resource} updated to revision: #{revision_int}"
end
end
diff --git a/spec/unit/provider/subversion_spec.rb b/spec/unit/provider/subversion_spec.rb
index f37a42d235..5d9d1cec1e 100644
--- a/spec/unit/provider/subversion_spec.rb
+++ b/spec/unit/provider/subversion_spec.rb
@@ -16,7 +16,6 @@
# limitations under the License.
#
-
require 'spec_helper'
describe Chef::Provider::Subversion do
@@ -199,7 +198,7 @@ describe Chef::Provider::Subversion do
it "runs an export with the --force option" do
::File.stub(:directory?).with("/my/deploy").and_return(true)
expected_cmd = "svn export --force -q -r12345 http://svn.example.org/trunk/ /my/deploy/dir"
- @provider.should_receive(:run_command).with(:command => expected_cmd)
+ @provider.should_receive(:shell_out!).with(command: expected_cmd)
@provider.run_action(:force_export)
@resource.should be_updated
end
@@ -207,7 +206,7 @@ describe Chef::Provider::Subversion do
it "runs the checkout command for action_checkout" do
::File.stub(:directory?).with("/my/deploy").and_return(true)
expected_cmd = "svn checkout -q -r12345 http://svn.example.org/trunk/ /my/deploy/dir"
- @provider.should_receive(:run_command).with(:command => expected_cmd)
+ @provider.should_receive(:shell_out!).with(command: expected_cmd)
@provider.run_action(:checkout)
@resource.should be_updated
end
@@ -231,7 +230,7 @@ describe Chef::Provider::Subversion do
@resource.user "whois"
@resource.group "thisis"
expected_cmd = "svn checkout -q -r12345 http://svn.example.org/trunk/ /my/deploy/dir"
- @provider.should_receive(:run_command).with(:command => expected_cmd, :user => "whois", :group => "thisis")
+ @provider.should_receive(:shell_out!).with(command: expected_cmd, user: "whois", group: "thisis")
@provider.run_action(:checkout)
@resource.should be_updated
end
@@ -256,7 +255,7 @@ describe Chef::Provider::Subversion do
@provider.stub(:find_current_revision).and_return("11410")
@provider.stub(:current_revision_matches_target_revision?).and_return(false)
expected_cmd = "svn update -q -r12345 /my/deploy/dir"
- @provider.should_receive(:run_command).with(:command => expected_cmd)
+ @provider.should_receive(:shell_out!).with(command: expected_cmd)
@provider.run_action(:sync)
@resource.should be_updated
end
@@ -273,7 +272,7 @@ describe Chef::Provider::Subversion do
it "runs the export_command on action_export" do
::File.stub(:directory?).with("/my/deploy").and_return(true)
expected_cmd = "svn export --force -q -r12345 http://svn.example.org/trunk/ /my/deploy/dir"
- @provider.should_receive(:run_command).with(:command => expected_cmd)
+ @provider.should_receive(:shell_out!).with(command: expected_cmd)
@provider.run_action(:export)
@resource.should be_updated
end