From 411111b5ff88b682d7e9cc54a47573bccc3e3edc Mon Sep 17 00:00:00 2001 From: John Iacona Date: Wed, 28 Aug 2013 14:32:05 -0400 Subject: update git provider to handle checking out into an existing (empty) dir --- spec/unit/puppet/provider/vcsrepo/git_spec.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'spec/unit') diff --git a/spec/unit/puppet/provider/vcsrepo/git_spec.rb b/spec/unit/puppet/provider/vcsrepo/git_spec.rb index 68b6c0a..1a6d008 100644 --- a/spec/unit/puppet/provider/vcsrepo/git_spec.rb +++ b/spec/unit/puppet/provider/vcsrepo/git_spec.rb @@ -74,9 +74,10 @@ describe_provider :vcsrepo, :git, :resource => {:path => '/tmp/vcsrepo'} do end end - context "when the path is not a repository" do + context "when the path is not empty and not a repository" do it "should raise an exception" do provider.expects(:path_exists?).returns(true) + provider.expects(:path_empty?).returns(false) proc { provider.create }.should raise_error(Puppet::Error) end end @@ -102,9 +103,10 @@ describe_provider :vcsrepo, :git, :resource => {:path => '/tmp/vcsrepo'} do end end - context "when the path is not a repository" do + context "when the path is not empty and not a repository" do it "should raise an exception" do expects_directory?(true) + provider.expects(:path_empty?).returns(false) proc { provider.create }.should raise_error(Puppet::Error) end end -- cgit v1.2.3