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



25
26
27
# File 'lib/test_run/tests/minitest/wrappers/single_root.rb', line 25

def app_root
  files.first.app_root
end

#should_run?Boolean

Returns:

  • (Boolean)


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

def should_run?
  # keep working here!
  true
end

#to_commandObject



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

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