Class: DevSystem::FileShellTest

Inherits:
ShellTest show all
Defined in:
lib/dev_system/sub/shell/shells/file_shell_test.rb

Instance Method Summary collapse

Methods inherited from Liza::UnitTest

test_methods_defined

Methods inherited from Liza::Test

color, subsystem

Methods inherited from Liza::Unit

const_missing, division, part, system, #system, test_class

Instance Method Details

#tmp_dirObject

before do

puts tmp.to_s.magenta

end



7
8
9
10
11
12
13
14
15
16
17
# File 'lib/dev_system/sub/shell/shells/file_shell_test.rb', line 7

def tmp_dir
  @tmp_dir ||= begin
    name = self.class.name.split("::").map(&:snakefy).join "_"
    time = Time.now.strftime "%Y%m%d_%H%M%S"
    random = SecureRandom.hex 4
    ret = Pathname.new(Dir.pwd).join "tmp/test_#{App.mode}_#{name}_#{time}_#{random}"
    FileUtils.mkdir_p ret
    log "Created tmp_dir: #{ret}"
    ret
  end
end