Imported puppetlabs-vcsrepo
This commit is contained in:
parent
0938a13fe6
commit
18d9aa4a23
152 changed files with 9191 additions and 0 deletions
18
modules/vcsrepo/spec/support/filesystem_helpers.rb
Normal file
18
modules/vcsrepo/spec/support/filesystem_helpers.rb
Normal file
|
@ -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
|
7
modules/vcsrepo/spec/support/fixture_helpers.rb
Normal file
7
modules/vcsrepo/spec/support/fixture_helpers.rb
Normal file
|
@ -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
|
Loading…
Add table
Add a link
Reference in a new issue