Module: Hotch::Memory::Minitest

Defined in:
lib/hotch/memory/minitest.rb

Class Method Summary collapse

Class Method Details

.aggregate(**options) ⇒ Object



16
17
18
19
20
21
22
23
24
25
# File 'lib/hotch/memory/minitest.rb', line 16

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

.run(**options) ⇒ Object

Usage in test/test_helper.rb:

require 'hotch/memory/minitest'

Hotch::Memory::Minitest.run
Hotch::Memory::Minitest.run(name: "my name")


12
13
14
# File 'lib/hotch/memory/minitest.rb', line 12

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