diff options
author | Hunter Haugen <hunter@puppetlabs.com> | 2014-06-20 13:48:02 -0700 |
---|---|---|
committer | Hunter Haugen <hunter@puppetlabs.com> | 2014-06-26 11:39:30 -0700 |
commit | 818f5298b6be3b1a25e997ba84eae237d9051be9 (patch) | |
tree | 0a63e808d40aae42c7abd29412fa18a7122061cf /spec/unit/puppet/provider | |
parent | e42310c7fb082a20f4155d801e41b980400ae045 (diff) | |
download | puppet-vcsrepo-818f5298b6be3b1a25e997ba84eae237d9051be9.tar.gz puppet-vcsrepo-818f5298b6be3b1a25e997ba84eae237d9051be9.tar.bz2 |
Update noop to work
Diffstat (limited to 'spec/unit/puppet/provider')
-rw-r--r-- | spec/unit/puppet/provider/vcsrepo/git_spec.rb | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/spec/unit/puppet/provider/vcsrepo/git_spec.rb b/spec/unit/puppet/provider/vcsrepo/git_spec.rb index a753610..2fd63f0 100644 --- a/spec/unit/puppet/provider/vcsrepo/git_spec.rb +++ b/spec/unit/puppet/provider/vcsrepo/git_spec.rb @@ -175,6 +175,28 @@ branches provider.expects(:git).with('checkout', '--force', resource.value(:revision)) provider.create end + it "should warn about destroying it using force and noop attribute" do + resource[:force] = true + resource[:noop] = true + resource.delete(:revision) + provider.expects(:working_copy_exists?).returns(true) + + provider.expects(:destroy).never + provider.expects(:create).never + Puppet::Type::Vcsrepo::Ensure.any_instance.expects(:send_log).with(:notice, "Noop Mode - Would have deleted repository and re-created from latest") + provider.resource.retrieve + end + it "should warn about destroying it using force and global noop" do + resource[:force] = true + Puppet[:noop] = true + resource.delete(:revision) + provider.expects(:working_copy_exists?).returns(true) + + provider.expects(:destroy).never + provider.expects(:create).never + Puppet::Type::Vcsrepo::Ensure.any_instance.expects(:send_log).with(:notice, "Noop Mode - Would have deleted repository and re-created from latest") + provider.resource.retrieve + end end context "when the path is not empty and not a repository" do |