Sha256: c21da0ced51ae22e9a30977c1b32fe2174b0bf22321bf86d5375f02d54d4cdd0

Contents?: true

Size: 726 Bytes

Versions: 1

Compression:

Stored size: 726 Bytes

Contents

# frozen_string_literal: true

require "hotch"

class Hotch
  module Minitest
    # 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 })
    #
    def self.run(**options)
      ::Minitest.singleton_class.prepend Hotch::Minitest.aggregate(**options)
    end

    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
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
hotch-0.7.0 lib/hotch/minitest.rb