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
118 119 120 |
# File 'lib/mutant/integration/minitest.rb', line 118 def all_tests all_tests_index.keys end |
#call(tests) ⇒ Result::Test
Call test integration
rubocop:disable Metrics/MethodLength
95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 |
# File 'lib/mutant/integration/minitest.rb', line 95 def call(tests) test_cases = tests.map(&all_tests_index.method(:fetch)) start = timer.now reporter = ::Minitest::SummaryReporter.new($stdout) reporter.start test_cases.each do |test| break unless test.call(reporter) end reporter.report Result::Test.new( passed: reporter.passed?, runtime: timer.now - start ) end |
#setup ⇒ self
Setup integration
80 81 82 83 84 85 86 |
# File 'lib/mutant/integration/minitest.rb', line 80 def setup Pathname.glob(TEST_FILE_PATTERN) .map(&:to_s) .each(&world.kernel.method(:require)) self end |