Class: TestRun::Tests::Minitest::Wrappers::MultipleRoots
- Inherits:
-
Object
- Object
- TestRun::Tests::Minitest::Wrappers::MultipleRoots
- Defined in:
- lib/test_run/tests/minitest/wrappers/multiple_roots.rb
Instance Attribute Summary collapse
-
#roots ⇒ Object
readonly
Returns the value of attribute roots.
-
#shell ⇒ Object
readonly
Returns the value of attribute shell.
Instance Method Summary collapse
-
#initialize(files, shell) ⇒ MultipleRoots
constructor
A new instance of MultipleRoots.
- #should_run? ⇒ Boolean
- #to_command ⇒ Object
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
#roots ⇒ Object (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 |
#shell ⇒ Object (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
#should_run? ⇒ Boolean
20 21 22 |
# File 'lib/test_run/tests/minitest/wrappers/multiple_roots.rb', line 20 def should_run? shell.confirm?("Found #{roots.inject(0) {|sum, root| sum + root.files.size }} test files in #{roots.size} apps/engines. Run them all?") end |
#to_command ⇒ Object
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 |