summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--chef/lib/chef/resource/scm.rb4
-rw-r--r--chef/lib/chef/resource/subversion.rb2
-rw-r--r--chef/spec/unit/provider/subversion_spec.rb2
-rw-r--r--chef/spec/unit/resource/subversion_spec.rb20
4 files changed, 26 insertions, 2 deletions
diff --git a/chef/lib/chef/resource/scm.rb b/chef/lib/chef/resource/scm.rb
index 081813147d..29191de32a 100644
--- a/chef/lib/chef/resource/scm.rb
+++ b/chef/lib/chef/resource/scm.rb
@@ -92,6 +92,7 @@ class Chef
end
def svn_arguments(arg=nil)
+ @svn_arguments, arg = nil, nil if arg == false
set_or_return(
:svn_arguments,
arg,
@@ -100,8 +101,9 @@ class Chef
end
def svn_info_args(arg=nil)
+ @svn_info_args, arg = nil, nil if arg == false
set_or_return(
- :svn_arguments,
+ :svn_info_args,
arg,
:kind_of => String)
end
diff --git a/chef/lib/chef/resource/subversion.rb b/chef/lib/chef/resource/subversion.rb
index 488a47e8bd..97f48c3a44 100644
--- a/chef/lib/chef/resource/subversion.rb
+++ b/chef/lib/chef/resource/subversion.rb
@@ -24,6 +24,8 @@ class Chef
def initialize(name, run_context=nil)
super
+ @svn_arguments = '--no-auth-cache'
+ @svn_info_args = '--no-auth-cache'
@resource_name = :subversion
@provider = Chef::Provider::Subversion
allowed_actions << :force_export
diff --git a/chef/spec/unit/provider/subversion_spec.rb b/chef/spec/unit/provider/subversion_spec.rb
index e7ae1f409a..f38db85f1b 100644
--- a/chef/spec/unit/provider/subversion_spec.rb
+++ b/chef/spec/unit/provider/subversion_spec.rb
@@ -26,6 +26,8 @@ describe Chef::Provider::Subversion do
@resource.repository "http://svn.example.org/trunk/"
@resource.destination "/my/deploy/dir"
@resource.revision "12345"
+ @resource.svn_arguments(false)
+ @resource.svn_info_args(false)
@node = Chef::Node.new
@run_context = Chef::RunContext.new(@node, {})
@provider = Chef::Provider::Subversion.new(@resource, @run_context)
diff --git a/chef/spec/unit/resource/subversion_spec.rb b/chef/spec/unit/resource/subversion_spec.rb
index c0cd6a989e..5b71747d2d 100644
--- a/chef/spec/unit/resource/subversion_spec.rb
+++ b/chef/spec/unit/resource/subversion_spec.rb
@@ -36,5 +36,23 @@ describe Chef::Resource::Subversion do
it "allows the force_export action" do
@svn.allowed_actions.should include(:force_export)
end
-
+
+ it "sets svn info arguments to --no-auth-cache by default" do
+ @svn.svn_info_args.should == '--no-auth-cache'
+ end
+
+ it "resets svn info arguments to nil when given false in the setter" do
+ @svn.svn_info_args(false)
+ @svn.svn_info_args.should be_nil
+ end
+
+ it "sets svn arguments to --no-auth-cache by default" do
+ @svn.svn_arguments.should == '--no-auth-cache'
+ end
+
+ it "resets svn arguments to nil when given false in the setter" do
+ @svn.svn_arguments(false)
+ @svn.svn_arguments.should be_nil
+ end
+
end \ No newline at end of file