Sha256: 23124b9ff3426576613a481650587b0b33fdc0ef7d244122ec6e07dea517198d

Contents?: true

Size: 743 Bytes

Versions: 12

Compression:

Stored size: 743 Bytes

Contents

module Mocha
  module Detection
    module TestUnit
      def self.testcase
        if defined?(::Test::Unit::TestCase) &&
           !(defined?(::Minitest::Unit::TestCase) && (::Test::Unit::TestCase < ::Minitest::Unit::TestCase)) &&
           !(defined?(::Minitest::Spec) && (::Test::Unit::TestCase < ::Minitest::Spec))
          ::Test::Unit::TestCase
        end
      end

      def self.version
        version = '1.0.0'
        if testcase
          begin
            require 'test/unit/version'
          rescue LoadError # rubocop:disable Lint/HandleExceptions
          end
          if defined?(::Test::Unit::VERSION)
            version = ::Test::Unit::VERSION
          end
        end
        version
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
mocha-2.7.1 lib/mocha/detection/test_unit.rb
mocha-2.7.0 lib/mocha/detection/test_unit.rb
mocha-2.6.1 lib/mocha/detection/test_unit.rb
mocha-2.6.0 lib/mocha/detection/test_unit.rb
mocha-2.5.0 lib/mocha/detection/test_unit.rb
mocha-2.4.5 lib/mocha/detection/test_unit.rb
mocha-2.4.4 lib/mocha/detection/test_unit.rb
mocha-2.4.3 lib/mocha/detection/test_unit.rb
mocha-2.4.2 lib/mocha/detection/test_unit.rb
mocha-2.4.1 lib/mocha/detection/test_unit.rb
mocha-2.4.0 lib/mocha/detection/test_unit.rb
mocha-2.2.0 lib/mocha/detection/test_unit.rb