Class: TestRun::Tests::Minitest::Wrappers::MultipleRoots

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(files, shell) ⇒ MultipleRoots

Returns a new instance of MultipleRoots.



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

def initialize(files, shell)
  @shell = shell
  @roots = files.map {|f| SingleFile.new(f)}.group_by {|f| f.app_root}.map {|root, _files| SingleRoot.new(_files, shell)}
end

Instance Attribute Details

#rootsObject (readonly)

Returns the value of attribute roots.



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

def roots
  @roots
end

#shellObject (readonly)

Returns the value of attribute shell.



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

def shell
  @shell
end

Instance Method Details

#to_commandObject



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

def to_command
  roots.map(&:to_command).join("; cd -;\n\n")
end