summaryrefslogtreecommitdiff
path: root/spec/unit/puppet/provider/vcsrepo
diff options
context:
space:
mode:
authorStuart Whelan <stuart@somepointinthefuture.co.nz>2014-06-21 17:26:14 +1200
committerAaron Stone <aaron@serendipity.cx>2014-06-23 14:57:46 -0700
commit2ff03cff1795d3e43c922f7bceb235ce69175013 (patch)
treed901938009082ea30fc23762a9692ff0b331a61c /spec/unit/puppet/provider/vcsrepo
parente42310c7fb082a20f4155d801e41b980400ae045 (diff)
downloadpuppet-vcsrepo-2ff03cff1795d3e43c922f7bceb235ce69175013.tar.gz
puppet-vcsrepo-2ff03cff1795d3e43c922f7bceb235ce69175013.tar.bz2
Added support for basic authentication to hg provider
Updated unit tests Updated hg readme and added examples
Diffstat (limited to 'spec/unit/puppet/provider/vcsrepo')
-rw-r--r--spec/unit/puppet/provider/vcsrepo/hg_spec.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/spec/unit/puppet/provider/vcsrepo/hg_spec.rb b/spec/unit/puppet/provider/vcsrepo/hg_spec.rb
index 7fd5348..6b21c1c 100644
--- a/spec/unit/puppet/provider/vcsrepo/hg_spec.rb
+++ b/spec/unit/puppet/provider/vcsrepo/hg_spec.rb
@@ -42,6 +42,22 @@ describe Puppet::Type.type(:vcsrepo).provider(:hg) do
provider.create
end
end
+
+ context "when basic auth is used" do
+ it "should execute 'hg clone'" do
+ resource[:source] = 'something'
+ resource[:basic_auth_username] = 'user'
+ resource[:basic_auth_password] = 'pass'
+ provider.expects(:hg).with('clone',
+ resource.value(:source),
+ resource.value(:path),
+ "--config","\"auth.x.prefix=" + resource.value(:source) + "\"",
+ "--config","\"auth.x.username=" + resource.value(:basic_auth_username) + "\"",
+ "--config","\"auth.x.password=" + resource.value(:basic_auth_password) + "\"",
+ "--config","\"auth.x.schemes=http https" + "\"")
+ provider.create
+ end
+ end
end
describe 'destroying' do