Sha256: e37b3ed310f6704d79556e9203090d2f8dca022c183367a5d5f2538727c9c9f6

Contents?: true

Size: 782 Bytes

Versions: 17

Compression:

Stored size: 782 Bytes

Contents

require 'mocha/debug'
require 'mocha/detection/test_unit'
require 'mocha/integration/test_unit/adapter'

module Mocha
  module Integration
    module TestUnit
      def self.activate
        target = Detection::TestUnit.testcase
        return false unless target

        test_unit_version = Gem::Version.new(Detection::TestUnit.version)
        Debug.puts "Detected Test::Unit version: #{test_unit_version}"

        unless TestUnit::Adapter.applicable_to?(test_unit_version)
          raise 'Versions of test-unit earlier than v2.5.1 are not supported.'
        end

        unless target < TestUnit::Adapter
          Debug.puts "Applying #{TestUnit::Adapter.description}"
          target.send(:include, TestUnit::Adapter)
        end

        true
      end
    end
  end
end

Version data entries

17 entries across 17 versions & 2 rubygems

Version Path
mocha-2.5.0 lib/mocha/integration/test_unit.rb
mocha-2.4.5 lib/mocha/integration/test_unit.rb
mocha-2.4.4 lib/mocha/integration/test_unit.rb
mocha-2.4.3 lib/mocha/integration/test_unit.rb
mocha-2.4.2 lib/mocha/integration/test_unit.rb
mocha-2.4.1 lib/mocha/integration/test_unit.rb
mocha-2.4.0 lib/mocha/integration/test_unit.rb
mocha-2.2.0 lib/mocha/integration/test_unit.rb
mocha-2.1.0 lib/mocha/integration/test_unit.rb
mocha-2.0.4 lib/mocha/integration/test_unit.rb
mocha-2.0.3 lib/mocha/integration/test_unit.rb
fluent-plugin-google-cloud-logging-on-prem-0.1.0 vendor/ruby/3.1.0/gems/mocha-2.0.2/lib/mocha/integration/test_unit.rb
mocha-2.0.2 lib/mocha/integration/test_unit.rb
mocha-2.0.1 lib/mocha/integration/test_unit.rb
mocha-2.0.0 lib/mocha/integration/test_unit.rb
mocha-2.0.0.alpha.1 lib/mocha/integration/test_unit.rb
mocha-2.0.0.alpha lib/mocha/integration/test_unit.rb