Sha256: 9b0e43a7a91961c60b57df26a57d07d3899681eb423b70e7197239b303319686

Contents?: true

Size: 1.24 KB

Versions: 63

Compression:

Stored size: 1.24 KB

Contents

unless defined?(Minitest) then
  # all of this crap is just to avoid circular requires and is only
  # needed if a user requires "minitest/unit" directly instead of
  # "minitest/autorun", so we also warn

  from = caller.reject { |s| s =~ /rubygems/ }.join("\n  ")
  warn "Warning: you should require 'minitest/autorun' instead."
  warn %(Warning: or add 'gem "minitest"' before 'require "minitest/autorun"')
  warn "From:\n  #{from}"

  module Minitest # :nodoc:
  end
  MiniTest = Minitest # :nodoc: # prevents minitest.rb from requiring back to us
  require "minitest"
end

MiniTest = Minitest unless defined?(MiniTest)

module Minitest
  class Unit # :nodoc:
    VERSION = Minitest::VERSION
    class TestCase < Minitest::Test # :nodoc:
      def self.inherited klass # :nodoc:
        from = caller.first
        warn "MiniTest::Unit::TestCase is now Minitest::Test. From #{from}"
        super
      end
    end

    def self.autorun # :nodoc:
      from = caller.first
      warn "MiniTest::Unit.autorun is now Minitest.autorun. From #{from}"
      Minitest.autorun
    end

    def self.after_tests &b # :nodoc:
      from = caller.first
      warn "MiniTest::Unit.after_tests is now Minitest.after_run. From #{from}"
      Minitest.after_run(&b)
    end
  end
end

Version data entries

63 entries across 51 versions & 15 rubygems

Version Path
katalyst-govuk-formbuilder-1.9.2 vendor/bundle/ruby/3.3.0/gems/minitest-5.23.1/lib/minitest/unit.rb
tinymce-rails-7.1.2 vendor/bundle/ruby/3.3.0/gems/minitest-5.23.1/lib/minitest/unit.rb
minitest-5.22.3 lib/minitest/unit.rb
direct7-0.0.13 vendor/bundle/ruby/3.0.0/gems/minitest-5.20.0/lib/minitest/unit.rb
direct7-0.0.13 vendor/bundle/ruby/2.7.0/gems/minitest-5.20.0/lib/minitest/unit.rb
minitest-5.22.2 lib/minitest/unit.rb
minitest-5.22.1 lib/minitest/unit.rb
minitest-5.22.0 lib/minitest/unit.rb
direct7-0.0.12 vendor/bundle/ruby/2.7.0/gems/minitest-5.20.0/lib/minitest/unit.rb
direct7-0.0.12 vendor/bundle/ruby/3.0.0/gems/minitest-5.20.0/lib/minitest/unit.rb
mlh-rubocop-config-1.0.3 vendor/bundle/ruby/3.2.0/gems/minitest-5.21.2/lib/minitest/unit.rb
minitest-5.21.2 lib/minitest/unit.rb
minitest-5.21.1 lib/minitest/unit.rb
minitest-5.21.0 lib/minitest/unit.rb
getargv-0.3.3-universal-darwin vendor/bundle/ruby/3.3.0/gems/minitest-5.20.0/lib/minitest/unit.rb
direct7-0.0.11 vendor/bundle/ruby/2.7.0/gems/minitest-5.20.0/lib/minitest/unit.rb
direct7-0.0.11 vendor/bundle/ruby/3.0.0/gems/minitest-5.20.0/lib/minitest/unit.rb
scrapbook-0.3.2 vendor/ruby/2.7.0/gems/minitest-5.18.1/lib/minitest/unit.rb
scrapbook-0.3.2 vendor/ruby/2.7.0/gems/minitest-5.16.3/lib/minitest/unit.rb
scrapbook-0.3.2 vendor/ruby/2.7.0/gems/minitest-5.16.2/lib/minitest/unit.rb