Class: TestRun::Tests::Minitest::Wrappers::SingleFile

Inherits:
Struct
  • Object
show all
Defined in:
lib/test_run/tests/minitest/wrappers/single_file.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#fileObject

Returns the value of attribute file

Returns:

  • (Object)

    the current value of file



7
8
9
# File 'lib/test_run/tests/minitest/wrappers/single_file.rb', line 7

def file
  @file
end

Instance Method Details

#app_rootObject



13
14
15
16
17
18
# File 'lib/test_run/tests/minitest/wrappers/single_file.rb', line 13

def app_root
  exploded_path = Utils::Path.split(file)

  path = exploded_path[0...exploded_path.rindex("test")]
  File.join(path)
end

#relative_test_pathObject



20
21
22
23
24
# File 'lib/test_run/tests/minitest/wrappers/single_file.rb', line 20

def relative_test_path
  exploded_path = Utils::Path.split(file)
  path = exploded_path[exploded_path.rindex("test")..-1]
  File.join(path)
end

#to_commandObject



9
10
11
# File 'lib/test_run/tests/minitest/wrappers/single_file.rb', line 9

def to_command
  %{cd #{File.join(app_root)} && ruby -I test #{File.join(relative_test_path)}}
end