diff options
author | Ashley Penney <ashley.penney@puppetlabs.com> | 2014-01-11 10:12:50 -0800 |
---|---|---|
committer | Ashley Penney <ashley.penney@puppetlabs.com> | 2014-01-11 10:12:50 -0800 |
commit | f252283cf1501960f627e121d852b05f67c7214c (patch) | |
tree | c7c07c3b89776aef5d042ba999c8d98a6193cf8b /spec/unit/puppet | |
parent | 7ac346413211f2fd58abc6a7bbce5d35de2a7a04 (diff) | |
parent | 7845ea132b0b40a83d3e9284723cbf63e2b61a82 (diff) | |
download | puppet-vcsrepo-f252283cf1501960f627e121d852b05f67c7214c.tar.gz puppet-vcsrepo-f252283cf1501960f627e121d852b05f67c7214c.tar.bz2 |
Merge pull request #115 from instruct-br/use_remote_name_when_cloning_a_repo
git: actually use the remote parameter
Diffstat (limited to 'spec/unit/puppet')
-rw-r--r-- | spec/unit/puppet/provider/vcsrepo/git_spec.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/spec/unit/puppet/provider/vcsrepo/git_spec.rb b/spec/unit/puppet/provider/vcsrepo/git_spec.rb index c40388f..96c4f19 100644 --- a/spec/unit/puppet/provider/vcsrepo/git_spec.rb +++ b/spec/unit/puppet/provider/vcsrepo/git_spec.rb @@ -31,6 +31,19 @@ describe Puppet::Type.type(:vcsrepo).provider(:git_provider) do end end + context "with a remote not named 'origin'" do + it "should execute 'git clone --origin not_origin" do + resource[:remote] = 'not_origin' + Dir.expects(:chdir).with('/').at_least_once.yields + Dir.expects(:chdir).with('/tmp/test').at_least_once.yields + provider.expects(:git).with('clone', '--origin', 'not_origin', resource.value(:source), resource.value(:path)) + provider.expects(:update_submodules) + provider.expects(:git).with('branch', '-a').returns(resource.value(:revision)) + provider.expects(:git).with('checkout', '--force', resource.value(:revision)) + provider.create + end + end + context "with shallow clone enable" do it "should execute 'git clone --depth 1'" do resource[:revision] = 'only/remote' |