summaryrefslogtreecommitdiff
path: root/spec/unit/puppet/provider
diff options
context:
space:
mode:
authorBruce Williams <bruce@codefluency.com>2010-03-18 10:54:38 -0700
committerBruce Williams <bruce@codefluency.com>2010-03-18 10:54:38 -0700
commitdc64158c8cb818b7f583f5f7c8b5ce5197338ee0 (patch)
treee56556ab7bf221df39ee0714d3d9f99828485836 /spec/unit/puppet/provider
parent3439ff1939e1b547ac732fd5095b2d362296a0af (diff)
downloadpuppet-vcsrepo-dc64158c8cb818b7f583f5f7c8b5ce5197338ee0.tar.gz
puppet-vcsrepo-dc64158c8cb818b7f583f5f7c8b5ce5197338ee0.tar.bz2
Add submodule support to git provider
Diffstat (limited to 'spec/unit/puppet/provider')
-rw-r--r--spec/unit/puppet/provider/vcsrepo/git_spec.rb23
1 files changed, 15 insertions, 8 deletions
diff --git a/spec/unit/puppet/provider/vcsrepo/git_spec.rb b/spec/unit/puppet/provider/vcsrepo/git_spec.rb
index 073be13..f7864c0 100644
--- a/spec/unit/puppet/provider/vcsrepo/git_spec.rb
+++ b/spec/unit/puppet/provider/vcsrepo/git_spec.rb
@@ -10,13 +10,18 @@ describe_provider :vcsrepo, :git, :resource => {:path => '/tmp/vcsrepo'} do
provider.expects('git').with('clone', resource.value(:source), resource.value(:path))
expects_chdir
provider.expects('git').with('reset', '--hard', resource.value(:revision))
+ provider.expects(:git).with('submodule', 'init')
+ provider.expects(:git).with('submodule', 'update')
provider.create
end
end
resource_without :revision do
- it "should just execute 'git clone'" do
+ it "should execute 'git clone' and submodule commands" do
provider.expects(:git).with('clone', resource.value(:source), resource.value(:path))
+ expects_chdir
+ provider.expects(:git).with('submodule', 'init')
+ provider.expects(:git).with('submodule', 'update')
provider.create
end
end
@@ -25,15 +30,15 @@ describe_provider :vcsrepo, :git, :resource => {:path => '/tmp/vcsrepo'} do
resource_with :ensure => :bare do
resource_with :revision do
it "should just execute 'git clone --bare'" do
- subject.expects(:git).with('clone', '--bare', resource.value(:source), resource.value(:path))
- subject.create
+ provider.expects(:git).with('clone', '--bare', resource.value(:source), resource.value(:path))
+ provider.create
end
end
resource_without :revision do
it "should just execute 'git clone --bare'" do
- subject.expects(:git).with('clone', '--bare', resource.value(:source), resource.value(:path))
- subject.create
+ provider.expects(:git).with('clone', '--bare', resource.value(:source), resource.value(:path))
+ provider.create
end
end
end
@@ -134,8 +139,10 @@ describe_provider :vcsrepo, :git, :resource => {:path => '/tmp/vcsrepo'} do
context "setting the revision property" do
it "should use 'git fetch' and 'git reset'" do
expects_chdir
- provider.expects('git').with('fetch', 'origin')
- provider.expects('git').with('reset', '--hard', 'carcar')
+ provider.expects(:git).with('fetch', 'origin')
+ provider.expects(:git).with('reset', '--hard', 'carcar')
+ provider.expects(:git).with('submodule', 'init')
+ provider.expects(:git).with('submodule', 'update')
provider.revision = 'carcar'
end
end
@@ -143,7 +150,7 @@ describe_provider :vcsrepo, :git, :resource => {:path => '/tmp/vcsrepo'} do
context "updating references" do
it "should use 'git fetch --tags'" do
expects_chdir
- provider.expects('git').with('fetch', '--tags', 'origin')
+ provider.expects(:git).with('fetch', '--tags', 'origin')
provider.update_references
end
end