Class: TestRun::Tests::Minitest::Wrappers::SingleRoot

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(files, shell) ⇒ SingleRoot

Returns a new instance of SingleRoot.



11
12
13
14
# File 'lib/test_run/tests/minitest/wrappers/single_root.rb', line 11

def initialize(files, shell)
  @shell = shell
  @files = files.map {|f| f.is_a?(SingleFile) ? f : SingleFile.new(f)}
end

Instance Attribute Details

#filesObject (readonly)

Returns the value of attribute files.



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

def files
  @files
end

#shellObject (readonly)

Returns the value of attribute shell.



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

def shell
  @shell
end

Instance Method Details

#app_rootObject



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

def app_root
  files.first.app_root
end

#to_commandObject



16
17
18
# File 'lib/test_run/tests/minitest/wrappers/single_root.rb', line 16

def to_command
  %{cd #{app_root} && ruby -I test -e 'ARGV.each { |file| require(Dir.pwd + "/" + file) }' #{files.map(&:relative_test_path).join(" ")}}
end