Module: Unix::File

Includes:
Beaker::CommandFactory
Included in:
Mac::Host, Host
Defined in:
lib/beaker/host/unix/file.rb

Instance Attribute Summary

Attributes included from Beaker::CommandFactory

#assertions

Instance Method Summary collapse

Methods included from Beaker::CommandFactory

#execute, #fail_test

Instance Method Details

#file_exist?(path) ⇒ Boolean

Returns:

  • (Boolean)


16
17
18
19
# File 'lib/beaker/host/unix/file.rb', line 16

def file_exist?(path)
  result = exec(Beaker::Command.new("test -e #{path}"), :acceptable_exit_codes => [0, 1])
  result.exit_code == 0
end

#path_split(paths) ⇒ Object



12
13
14
# File 'lib/beaker/host/unix/file.rb', line 12

def path_split(paths)
  paths.split(':')
end

#tmpdir(name) ⇒ Object



8
9
10
# File 'lib/beaker/host/unix/file.rb', line 8

def tmpdir(name)
  execute("mktemp -dt #{name}.XXXXXX")
end

#tmpfile(name) ⇒ Object



4
5
6
# File 'lib/beaker/host/unix/file.rb', line 4

def tmpfile(name)
  execute("mktemp -t #{name}.XXXXXX")
end