diff options
author | Stuart Whelan <stuart@somepointinthefuture.co.nz> | 2014-06-21 17:26:14 +1200 |
---|---|---|
committer | Aaron Stone <aaron@serendipity.cx> | 2014-06-23 14:57:46 -0700 |
commit | 2ff03cff1795d3e43c922f7bceb235ce69175013 (patch) | |
tree | d901938009082ea30fc23762a9692ff0b331a61c /spec/unit/puppet/provider | |
parent | e42310c7fb082a20f4155d801e41b980400ae045 (diff) | |
download | puppet-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')
-rw-r--r-- | spec/unit/puppet/provider/vcsrepo/hg_spec.rb | 16 |
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 |