summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Gemfile1
-rw-r--r--lib/puppet/provider/vcsrepo/svn.rb2
-rw-r--r--lib/puppet/type/vcsrepo.rb2
-rw-r--r--spec/unit/puppet/provider/vcsrepo/svn_spec.rb10
4 files changed, 12 insertions, 3 deletions
diff --git a/Gemfile b/Gemfile
index bfe64b1..ee1eb6b 100644
--- a/Gemfile
+++ b/Gemfile
@@ -16,6 +16,7 @@ group :development, :unit_tests do
gem 'simplecov', :require => false
gem 'puppet_facts', :require => false
gem 'json', :require => false
+ gem 'pry', :require => false
end
group :system_tests do
diff --git a/lib/puppet/provider/vcsrepo/svn.rb b/lib/puppet/provider/vcsrepo/svn.rb
index ba77464..fccfaa5 100644
--- a/lib/puppet/provider/vcsrepo/svn.rb
+++ b/lib/puppet/provider/vcsrepo/svn.rb
@@ -63,7 +63,7 @@ Puppet::Type.type(:vcsrepo).provide(:svn, :parent => Puppet::Provider::Vcsrepo)
args.push('--config-dir', @resource.value(:configuration))
end
- if @resource.value(:trust_server_cert)
+ if @resource.value(:trust_server_cert) != :false
args.push('--trust-server-cert')
end
diff --git a/lib/puppet/type/vcsrepo.rb b/lib/puppet/type/vcsrepo.rb
index da1dcde..290bdad 100644
--- a/lib/puppet/type/vcsrepo.rb
+++ b/lib/puppet/type/vcsrepo.rb
@@ -231,7 +231,7 @@ Puppet::Type.newtype(:vcsrepo) do
newparam :trust_server_cert do
desc "Trust server certificate"
newvalues(:true, :false)
- defaultto false
+ defaultto :false
end
autorequire(:package) do
diff --git a/spec/unit/puppet/provider/vcsrepo/svn_spec.rb b/spec/unit/puppet/provider/vcsrepo/svn_spec.rb
index 25951bd..6a37c20 100644
--- a/spec/unit/puppet/provider/vcsrepo/svn_spec.rb
+++ b/spec/unit/puppet/provider/vcsrepo/svn_spec.rb
@@ -65,9 +65,17 @@ describe Puppet::Type.type(:vcsrepo).provider(:svn) do
end
context "with trust_server_cert" do
+ it "should execute 'svn checkout' without a trust-server-cert" do
+ resource[:source] = 'exists'
+ resource[:trust_server_cert] = :false
+ provider.expects(:svn).with('--non-interactive', 'checkout',
+ resource.value(:source),
+ resource.value(:path))
+ provider.create
+ end
it "should execute 'svn checkout' with a trust-server-cert" do
resource[:source] = 'exists'
- resource[:trust_server_cert] = true
+ resource[:trust_server_cert] = :true
provider.expects(:svn).with('--non-interactive', '--trust-server-cert', 'checkout',
resource.value(:source),
resource.value(:path))