Sha256: d6c152b951f12998a91a56eb29b5c30038b80faef15a610fe47c9e54dd7002b7

Contents?: true

Size: 1011 Bytes

Versions: 11

Compression:

Stored size: 1011 Bytes

Contents

# frozen_string_literal: true

require 'bundler/setup'

require 'fileutils'
require_relative './eg'

require_relative './coverage' if ENV['COVERAGE']

require 'minitest/autorun'
require 'minitest/reporters'

require 'polyphony'

::Exception.__disable_sanitized_backtrace__ = true

Minitest::Reporters.use! [
  Minitest::Reporters::SpecReporter.new
]

class MiniTest::Test
  def setup
    # puts "* setup #{self.name}"
    if Fiber.current.children.size > 0
      puts "Children left: #{Fiber.current.children.inspect}"
      exit!
    end
    Fiber.current.setup_main_fiber
    Fiber.current.instance_variable_set(:@auto_watcher, nil)
    Thread.current.backend = Polyphony::Backend.new
    sleep 0
  end

  def teardown
    # puts "* teardown #{self.name.inspect} Fiber.current: #{Fiber.current.inspect}"
    Fiber.current.shutdown_all_children
  rescue => e
    puts e
    puts e.backtrace.join("\n")
    exit!
  end
end

module Kernel
  def capture_exception
    yield
  rescue Exception => e
    e
  end
end

Version data entries

11 entries across 11 versions & 2 rubygems

Version Path
tipi-0.41 test/helper.rb
tipi-0.40 test/helper.rb
htio-0.1 test/helper.rb
tipi-0.39 test/helper.rb
tipi-0.38 test/helper.rb
tipi-0.37.2 test/helper.rb
tipi-0.37.1 test/helper.rb
tipi-0.37 test/helper.rb
tipi-0.36 test/helper.rb
tipi-0.35 test/helper.rb
tipi-0.34 test/helper.rb