Class: Mutant::Integration::Minitest
- Inherits:
-
Mutant::Integration
- Object
- Mutant::Integration
- Mutant::Integration::Minitest
- Defined in:
- lib/mutant/integration/minitest.rb
Overview
Minitest integration
Defined Under Namespace
Classes: TestCase
Constant Summary collapse
- TEST_FILE_PATTERN =
'./test/**/{test_*,*_test}.rb'- IDENTIFICATION_FORMAT =
'minitest:%s#%s'
Instance Method Summary collapse
-
#all_tests ⇒ Array<Test>
All tests exposed by this integration.
-
#call(tests) ⇒ Result::Test
Call test integration.
-
#setup ⇒ self
Setup integration.
Instance Method Details
#all_tests ⇒ Array<Test>
All tests exposed by this integration
108 109 110 |
# File 'lib/mutant/integration/minitest.rb', line 108 def all_tests all_tests_index.keys end |
#call(tests) ⇒ Result::Test
Call test integration
rubocop:disable MethodLength
ignore :reek:TooManyStatements
82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 |
# File 'lib/mutant/integration/minitest.rb', line 82 def call(tests) test_cases = tests.map(&all_tests_index.method(:fetch)) output = StringIO.new start = Timer.now reporter = ::Minitest::SummaryReporter.new(output) reporter.start test_cases.each do |test| break unless test.call(reporter) end output.rewind Result::Test.new( passed: reporter.passed?, tests: tests, output: output.read, runtime: Timer.now - start ) end |
#setup ⇒ self
Setup integration
65 66 67 68 69 70 71 |
# File 'lib/mutant/integration/minitest.rb', line 65 def setup Pathname.glob(TEST_FILE_PATTERN) .map(&:to_s) .each(&method(:require)) self end |