Module: Hotch::Minitest

Defined in:
lib/hotch/minitest.rb

Class Method Summary collapse

Class Method Details

.aggregate(**options) ⇒ Object



18
19
20
21
22
23
24
25
26
27
# File 'lib/hotch/minitest.rb', line 18

def self.aggregate(**options)
  Module.new do
    define_method(:run_one_method) do |*args|
      options[:aggregate] = true
      Hotch(**options) do
        super(*args)
      end
    end
  end
end

.run(**options) ⇒ Object

Usage in test/test_helper.rb:

require 'hotch/minitest'

Hotch::Minitest.run
Hotch::Minitest.run(filter: /MyClass/)
Hotch::Minitest.run(options: <stackprof options>)
Hotch::Minitest.run(options: { limit: 200 })


14
15
16
# File 'lib/hotch/minitest.rb', line 14

def self.run(**options)
  ::Minitest.singleton_class.prepend Hotch::Minitest.aggregate(**options)
end