Class: TestQueue::TestFramework::TestUnit
- Inherits:
-
TestQueue::TestFramework
- Object
- TestQueue::TestFramework
- TestQueue::TestFramework::TestUnit
- Defined in:
- lib/test_queue/runner/testunit.rb
Constant Summary
Constants inherited from TestQueue::TestFramework
Instance Method Summary collapse
- #all_suite_files ⇒ Object
- #split_groups(test_suite, groups = []) ⇒ Object
- #split_groups? ⇒ Boolean
- #splittable?(test_suite) ⇒ Boolean
- #suites_from_file(path) ⇒ Object
Instance Method Details
#all_suite_files ⇒ Object
72 73 74 |
# File 'lib/test_queue/runner/testunit.rb', line 72 def all_suite_files ARGV end |
#split_groups(test_suite, groups = []) ⇒ Object
90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 |
# File 'lib/test_queue/runner/testunit.rb', line 90 def split_groups(test_suite, groups = []) unless splittable?(test_suite) groups << [test_suite.name, test_suite] return groups end test_suite.tests.each do |suite| if suite.is_a?(Test::Unit::TestSuite) split_groups(suite, groups) else groups << [suite.name, suite] end end groups end |
#split_groups? ⇒ Boolean
84 85 86 87 88 |
# File 'lib/test_queue/runner/testunit.rb', line 84 def split_groups? return @split_groups if defined?(@split_groups) @split_groups = ENV['TEST_QUEUE_SPLIT_GROUPS'] && ENV['TEST_QUEUE_SPLIT_GROUPS'].strip.downcase == 'true' end |
#splittable?(test_suite) ⇒ Boolean
106 107 108 109 110 |
# File 'lib/test_queue/runner/testunit.rb', line 106 def splittable?(test_suite) test_suite.tests.none? do |test| test.is_a?(Test::Unit::TestCase) && test[:no_split] end end |
#suites_from_file(path) ⇒ Object
76 77 78 79 80 81 82 |
# File 'lib/test_queue/runner/testunit.rb', line 76 def suites_from_file(path) test_suite = Test::Unit::Collector::Load.new.collect(path) return [] unless test_suite return test_suite.tests.map { [_1.name, _1] } unless split_groups? split_groups(test_suite) end |