diff options
author | Micah <micah@leap.se> | 2016-05-24 10:19:38 -0400 |
---|---|---|
committer | Micah <micah@leap.se> | 2016-05-24 10:19:38 -0400 |
commit | 92a1ac5b29b497ee659c8097a5c0de94a481181c (patch) | |
tree | e9c325ad24a732b6bdb13801ef2997f10f99e02e /spec/support/filesystem_helpers.rb |
Squashed 'puppet/modules/vcsrepo/' content from commit 4e23209
git-subtree-dir: puppet/modules/vcsrepo
git-subtree-split: 4e23209eaccf1ab504d35158f4141b3053327c2f
Diffstat (limited to 'spec/support/filesystem_helpers.rb')
-rw-r--r-- | spec/support/filesystem_helpers.rb | 18 |
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 00000000..15e2ca75 --- /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 |