summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
Diffstat (limited to 'spec')
-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