summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruce Williams <bruce@codefluency.com>2010-03-18 01:05:41 -0700
committerBruce Williams <bruce@codefluency.com>2010-03-18 01:05:41 -0700
commite1470a239f2d82d2032b179a0eb4052c4c1c4550 (patch)
tree6bbd20eddb88eda95ee96a9362d58cd5e38391d6
parentaf86e9ba814926f9ee236aabc2ca905b5668af70 (diff)
downloadpuppet-vcsrepo-e1470a239f2d82d2032b179a0eb4052c4c1c4550.tar.gz
puppet-vcsrepo-e1470a239f2d82d2032b179a0eb4052c4c1c4550.tar.bz2
Name filesystem helpers appropriately
-rw-r--r--spec/support/filesystem_helpers.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/spec/support/filesystem_helpers.rb b/spec/support/filesystem_helpers.rb
new file mode 100644
index 0000000..08345b4
--- /dev/null
+++ b/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