Module: Selective::Ruby::Minitest::Monkeypatches::Minitest
- Defined in:
- lib/selective/ruby/minitest/monkeypatches.rb
Instance Method Summary collapse
- #autorun ⇒ Object
-
#selective_postrun(reporter, args = []) ⇒ Object
This is the second half of ::Minitest.run.
-
#selective_prerun(args = []) ⇒ Object
This is the first half of Minitest.run.
Instance Method Details
#autorun ⇒ Object
6 7 8 9 |
# File 'lib/selective/ruby/minitest/monkeypatches.rb', line 6 def autorun # Noop. Rails calls autorun from: lib/active_support/testing/autorun.rb # when rails/test_help is required in test helper (which is normal rails test setup) end |
#selective_postrun(reporter, args = []) ⇒ Object
This is the second half of ::Minitest.run
34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/selective/ruby/minitest/monkeypatches.rb', line 34 def selective_postrun(reporter, args = []) = process_args args parallel_executor.shutdown # might have been removed/replaced during init_plugins: summary = reporter.reporters.grep(::Minitest::SummaryReporter).first reporter.report return empty_run! if summary && summary.count == 0 reporter.passed? end |
#selective_prerun(args = []) ⇒ Object
This is the first half of Minitest.run
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/selective/ruby/minitest/monkeypatches.rb', line 12 def selective_prerun(args = []) load_plugins unless args.delete("--no-plugins") || ENV["MT_NO_PLUGINS"] = process_args args ::Minitest.seed = [:seed] srand ::Minitest.seed reporter = ::Minitest::CompositeReporter.new reporter << ::Minitest::SummaryReporter.new([:io], ) reporter << ::Minitest::ProgressReporter.new([:io], ) unless [:quiet] self.reporter = reporter # this makes it available to plugins init_plugins .merge(report_name: ->(name) { "report-#{name}-#{SecureRandom.uuid}.xml" }) self.reporter = nil # runnables shouldn't depend on the reporter, ever parallel_executor.start if parallel_executor.respond_to?(:start) reporter.start reporter end |