summaryrefslogtreecommitdiff
path: root/puppet/modules/vcsrepo/spec/support
diff options
context:
space:
mode:
authorMicah <micah@leap.se>2016-05-24 10:19:38 -0400
committerMicah <micah@leap.se>2016-05-24 10:19:38 -0400
commitf5ab8dc148de8cc4cfd9df88ce9a81703405f8c5 (patch)
treeb26fa320d2b14b92fe6c6186054825260f5fa40d /puppet/modules/vcsrepo/spec/support
parent38ac177664f763f08153239992568f1aad04c89b (diff)
parent92a1ac5b29b497ee659c8097a5c0de94a481181c (diff)
Merge commit '92a1ac5b29b497ee659c8097a5c0de94a481181c' as 'puppet/modules/vcsrepo'
Diffstat (limited to 'puppet/modules/vcsrepo/spec/support')
-rw-r--r--puppet/modules/vcsrepo/spec/support/filesystem_helpers.rb18
-rw-r--r--puppet/modules/vcsrepo/spec/support/fixture_helpers.rb7
2 files changed, 25 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
diff --git a/puppet/modules/vcsrepo/spec/support/fixture_helpers.rb b/puppet/modules/vcsrepo/spec/support/fixture_helpers.rb
new file mode 100644
index 00000000..8a0e0a0b
--- /dev/null
+++ b/puppet/modules/vcsrepo/spec/support/fixture_helpers.rb
@@ -0,0 +1,7 @@
+module FixtureHelpers
+
+ def fixture(name, ext = '.txt')
+ File.read(File.join(File.dirname(__FILE__), '..', 'fixtures', name.to_s + ext))
+ end
+
+end