From 3ad5203b34c068101d8d47bf70259443e657a4ca Mon Sep 17 00:00:00 2001
From: Peter Souter
Date: Thu, 3 Jul 2014 19:04:59 +0100
Subject: (MODULES-1014) Add rspec for noop mode
---
spec/acceptance/remove_repo_spec_noop.rb | 31 +++++++++++++++++++++++++++++++
1 file changed, 31 insertions(+)
create mode 100644 spec/acceptance/remove_repo_spec_noop.rb
diff --git a/spec/acceptance/remove_repo_spec_noop.rb b/spec/acceptance/remove_repo_spec_noop.rb
new file mode 100644
index 0000000..154f25a
--- /dev/null
+++ b/spec/acceptance/remove_repo_spec_noop.rb
@@ -0,0 +1,31 @@
+require 'spec_helper_acceptance'
+
+tmpdir = default.tmpdir('vcsrepo')
+
+describe 'does not remove a repo if noop' do
+ it 'creates a blank repo' do
+ pp = <<-EOS
+ vcsrepo { "#{tmpdir}/testrepo_noop_deleted":
+ ensure => present,
+ provider => git,
+ }
+ EOS
+ apply_manifest(pp, :catch_failures => true)
+ end
+
+ it 'does not remove a repo if noop' do
+ pp = <<-EOS
+ vcsrepo { "#{tmpdir}/testrepo_noop_deleted":
+ ensure => absent,
+ provider => git,
+ force => true,
+ }
+ EOS
+
+ apply_manifest(pp, :catch_failures => true, :noop => true, :verbose => false)
+ end
+
+ describe file("#{tmpdir}/testrepo_noop_deleted") do
+ it { should be_directory }
+ end
+end
--
cgit v1.2.3