Method: Aruba::Api#clean_up

Defined in:
lib/aruba/api.rb

#clean_up(dir = current_dir) ⇒ Object

clean_up is an internal helper method that empties the current working directory of all content. It is used in the Aruba before hook to clear out the awd at the start of each scenario.

It will not clear any directory that does not contain the directory /tmp/ somewhare in its path.



301
302
303
304
305
306
307
308
309
# File 'lib/aruba/api.rb', line 301

def clean_up( dir = current_dir )
  check_tmp_dir = File.expand_path( dir )
  if File.fnmatch( '**/tmp/**', check_tmp_dir )
    clean_up!
  else
    raise "#{check_tmp_dir} is outside the tmp " + 
      "subtree and may not be deleted."
  end
end