Sha256: 852720b0fc5f3cf7222c97ce9c7a9dd35bc2d34cdb73feb1004e03d1a7b98df1

Contents?: true

Size: 843 Bytes

Versions: 3

Compression:

Stored size: 843 Bytes

Contents

module FIxMinitest
  def self.disable_autorun
    disable_auto_runner
    override_minitest_run
    override_minitest_unit_run
  end

  # rubocop:disable all
  def self.override_minitest_run
    Minitest.instance_eval do
      def run(*)
        FIxMinitest.run_mininitest
      end    
    end if defined?(Minitest)
  end
 
  # rubocop:disable NestedMethodDefinition
  def self.run_mininitest
    case $ERROR_INFO
      when SystemExit
        $ERROR_INFO.status
      else
        true
    end
  end
  # rubocop:disable NestedMethodDefinition
  def self.override_minitest_unit_run
    Minitest::Unit.class_eval do
      def run(*)
      end
    end if defined?(Minitest) && defined?(Minitest::Unit)
  end

  def self.disable_auto_runner
    Test::Unit::Runner.module_eval('@@stop_auto_run = true') if defined?(Test::Unit::Runner)
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
washout_builder-0.15.8 spec/support/fix_minitest.rb
washout_builder-0.15.7 spec/support/fix_minitest.rb
washout_builder-0.15.6 spec/support/fix_minitest.rb