From bfb413191999127e01699873ba061f91935fb9c3 Mon Sep 17 00:00:00 2001 From: varac Date: Thu, 9 Jun 2016 17:35:10 +0200 Subject: 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.git" commit: "cb2995b" --- .../modules/vcsrepo/spec/support/filesystem_helpers.rb | 18 ++++++++++++++++++ puppet/modules/vcsrepo/spec/support/fixture_helpers.rb | 7 +++++++ 2 files changed, 25 insertions(+) create mode 100644 puppet/modules/vcsrepo/spec/support/filesystem_helpers.rb create mode 100644 puppet/modules/vcsrepo/spec/support/fixture_helpers.rb (limited to 'puppet/modules/vcsrepo/spec/support') 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 -- cgit v1.2.3