File: filesystem_helpers.rb

package info (click to toggle)
puppet-module-puppetlabs-vcsrepo 1.3.2-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 828 kB
  • sloc: ruby: 6,359; sh: 44; makefile: 7
file content (18 lines) | stat: -rw-r--r-- 482 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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