summaryrefslogtreecommitdiff
path: root/puppet/modules/vcsrepo/spec/support/filesystem_helpers.rb
diff options
context:
space:
mode:
authorMicah <micah@leap.se>2016-07-12 16:46:26 -0400
committerMicah <micah@leap.se>2016-07-12 16:46:26 -0400
commit850a14b59444737f703686d0d1996bf09ab08e2b (patch)
tree6d67b59126fc9d8329b6acdd072b53b5ea35bc25 /puppet/modules/vcsrepo/spec/support/filesystem_helpers.rb
parent5247b7ccf5b5889ee16262dd976b03047e34e32c (diff)
git subrepo clone https://leap.se/git/puppet_vcsrepo puppet/modules/vcsrepo
subrepo: subdir: "puppet/modules/vcsrepo" merged: "4e23209" upstream: origin: "https://leap.se/git/puppet_vcsrepo" branch: "master" commit: "4e23209" git-subrepo: version: "0.3.0" origin: "https://github.com/ingydotnet/git-subrepo" commit: "1e79595" Change-Id: I72f8ecdef4855ef9da6e1486453b1cdf01bb54a3
Diffstat (limited to 'puppet/modules/vcsrepo/spec/support/filesystem_helpers.rb')
-rw-r--r--puppet/modules/vcsrepo/spec/support/filesystem_helpers.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/puppet/modules/vcsrepo/spec/support/filesystem_helpers.rb b/puppet/modules/vcsrepo/spec/support/filesystem_helpers.rb
new file mode 100644
index 00000000..15e2ca75
--- /dev/null
+++ b/puppet/modules/vcsrepo/spec/support/filesystem_helpers.rb
@@ -0,0 +1,18 @@
+module FilesystemHelpers
+
+ def expects_chdir(path = resource.value(:path))
+ Dir.expects(:chdir).with(path).at_least_once.yields
+ end
+
+ def expects_mkdir(path = resource.value(:path))
+ Dir.expects(:mkdir).with(path).at_least_once
+ end
+
+ def expects_rm_rf(path = resource.value(:path))
+ FileUtils.expects(:rm_rf).with(path)
+ end
+
+ def expects_directory?(returns = true, path = resource.value(:path))
+ File.expects(:directory?).with(path).returns(returns)
+ end
+end