Module: Mocha::Integration::MiniTest

### Home Classes Methods

### In Files

- lib/mocha/integration/mini_test.rb
- lib/mocha/integration/mini_test/adapter.rb
- lib/mocha/integration/mini_test/exception_translation.rb
- lib/mocha/integration/mini_test/nothing.rb
- lib/mocha/integration/mini_test/version_13.rb
- lib/mocha/integration/mini_test/version_140.rb
- lib/mocha/integration/mini_test/version_141.rb
- lib/mocha/integration/mini_test/version_142_to_172.rb
- lib/mocha/integration/mini_test/version_200.rb
- lib/mocha/integration/mini_test/version_201_to_222.rb
- lib/mocha/integration/mini_test/version_2110_to_2111.rb
- lib/mocha/integration/mini_test/version_2112_to_320.rb
- lib/mocha/integration/mini_test/version_230_to_2101.rb

### Namespace

- MODULE Mocha::Integration::MiniTest::Adapter
- MODULE Mocha::Integration::MiniTest::Nothing
- MODULE Mocha::Integration::MiniTest::Version13
- MODULE Mocha::Integration::MiniTest::Version140
- MODULE Mocha::Integration::MiniTest::Version141
- MODULE Mocha::Integration::MiniTest::Version142To172
- MODULE Mocha::Integration::MiniTest::Version200
- MODULE Mocha::Integration::MiniTest::Version201To222
- MODULE Mocha::Integration::MiniTest::Version2110To2111
- MODULE Mocha::Integration::MiniTest::Version2112To320
- MODULE Mocha::Integration::MiniTest::Version230To2101

### Methods

- ::activate
- ::translate

### Class/Module Index

Quicksearch

- Mocha
- Mocha::API
- Mocha::AnyInstanceMethod
- Mocha::AnyInstanceReceiver
- Mocha::ArgumentIterator
- Mocha::ArrayMethods
- Mocha::BacktraceFilter
- Mocha::Cardinality
- Mocha::Central
- Mocha::ChangeStateSideEffect
- Mocha::ClassMethod
- Mocha::ClassMethods
- Mocha::ClassMethods::AnyInstance
- Mocha::Configuration
- Mocha::DateMethods
- Mocha::Debug
- Mocha::DefaultName
- Mocha::DefaultReceiver
- Mocha::Deprecation
- Mocha::Detection
- Mocha::Detection::MiniTest
- Mocha::Detection::TestUnit
- Mocha::ExceptionRaiser
- Mocha::Expectation
- Mocha::ExpectationError
- Mocha::ExpectationErrorFactory
- Mocha::ExpectationList
- Mocha::HashMethods
- Mocha::Hooks
- Mocha::ImpersonatingAnyInstanceName
- Mocha::ImpersonatingName
- Mocha::InStateOrderingConstraint
- Mocha::InstanceMethod
- Mocha::Integration
- Mocha::Integration::AssertionCounter
- Mocha::Integration::MiniTest
- Mocha::Integration::MiniTest::Adapter
- Mocha::Integration::MiniTest::Nothing
- Mocha::Integration::MiniTest::Version13
- Mocha::Integration::MiniTest::Version13::RunMethodPatch
- Mocha::Integration::MiniTest::Version140
- Mocha::Integration::MiniTest::Version140::RunMethodPatch
- Mocha::Integration::MiniTest::Version141
- Mocha::Integration::MiniTest::Version141::RunMethodPatch
- Mocha::Integration::MiniTest::Version142To172
- Mocha::Integration::MiniTest::Version142To172::RunMethodPatch
- Mocha::Integration::MiniTest::Version200
- Mocha::Integration::MiniTest::Version200::RunMethodPatch
- Mocha::Integration::MiniTest::Version201To222
- Mocha::Integration::MiniTest::Version201To222::RunMethodPatch
- Mocha::Integration::MiniTest::Version2110To2111
- Mocha::Integration::MiniTest::Version2110To2111::RunMethodPatch
- Mocha::Integration::MiniTest::Version2112To320
- Mocha::Integration::MiniTest::Version2112To320::RunMethodPatch
- Mocha::Integration::MiniTest::Version230To2101
- Mocha::Integration::MiniTest::Version230To2101::RunMethodPatch
- Mocha::Integration::MonkeyPatcher
- Mocha::Integration::TestUnit
- Mocha::Integration::TestUnit::Adapter
- Mocha::Integration::TestUnit::GemVersion200
- Mocha::Integration::TestUnit::GemVersion200::RunMethodPatch
- Mocha::Integration::TestUnit::GemVersion201To202
- Mocha::Integration::TestUnit::GemVersion201To202::RunMethodPatch
- Mocha::Integration::TestUnit::GemVersion203To220
- Mocha::Integration::TestUnit::GemVersion203To220::RunMethodPatch
- Mocha::Integration::TestUnit::GemVersion230To250
- Mocha::Integration::TestUnit::GemVersion230To250::RunMethodPatch
- Mocha::Integration::TestUnit::Nothing
- Mocha::Integration::TestUnit::RubyVersion185AndBelow
- Mocha::Integration::TestUnit::RubyVersion185AndBelow::RunMethodPatch
- Mocha::Integration::TestUnit::RubyVersion186AndAbove
- Mocha::Integration::TestUnit::RubyVersion186AndAbove::RunMethodPatch
- Mocha::Logger
- Mocha::MethodMatcher
- Mocha::Mock
- Mocha::Mockery
- Mocha::ModuleMethod
- Mocha::ModuleMethods
- Mocha::MultipleYields
- Mocha::Name
- Mocha::NoYields
- Mocha::ObjectMethods
- Mocha::ObjectReceiver
- Mocha::ParameterMatchers
- Mocha::ParameterMatchers::AllOf
- Mocha::ParameterMatchers::AnyOf
- Mocha::ParameterMatchers::AnyParameters
- Mocha::ParameterMatchers::Anything
- Mocha::ParameterMatchers::Base
- Mocha::ParameterMatchers::Equals
- Mocha::ParameterMatchers::HasEntries
- Mocha::ParameterMatchers::HasEntry
- Mocha::ParameterMatchers::HasKey
- Mocha::ParameterMatchers::HasValue
- Mocha::ParameterMatchers::Includes
- Mocha::ParameterMatchers::InstanceOf
- Mocha::ParameterMatchers::IsA
- Mocha::ParameterMatchers::KindOf
- Mocha::ParameterMatchers::Not
- Mocha::ParameterMatchers::Optionally
- Mocha::ParameterMatchers::QueryStringMatches
- Mocha::ParameterMatchers::RegexpMatches
- Mocha::ParameterMatchers::RespondsWith
- Mocha::ParameterMatchers::YamlEquivalent
- Mocha::ParametersMatcher
- Mocha::PrettyParameters
- Mocha::ReturnValues
- Mocha::Sequence
- Mocha::Sequence::InSequenceOrderingConstraint
- Mocha::SingleReturnValue
- Mocha::SingleYield
- Mocha::StateMachine
- Mocha::StateMachine::State
- Mocha::StateMachine::StatePredicate
- Mocha::StringMethods
- Mocha::StubbingError
- Mocha::Thrower
- Mocha::TimeMethods
- Mocha::UnexpectedInvocation
- Mocha::YieldParameters
- Array
- Date
- Hash
- Object
- String
- Time

No matching classes.

# Mocha::Integration::MiniTest

### Public Class Methods

activate() click to toggle source

    # File lib/mocha/integration/mini_test.rb, line 20
    def self.activate
      return false unless Detection::MiniTest.testcase
      mini_test_version = Gem::Version.new(Detection::MiniTest.version)

      Debug.puts "Detected MiniTest version: #{mini_test_version}"

      integration_module = [
        MiniTest::Adapter,
        MiniTest::Version2112To320,
        MiniTest::Version2110To2111,
        MiniTest::Version230To2101,
        MiniTest::Version201To222,
        MiniTest::Version200,
        MiniTest::Version142To172,
        MiniTest::Version141,
        MiniTest::Version140,
        MiniTest::Version13,
        MiniTest::Nothing
      ].detect { |m| m.applicable_to?(mini_test_version) }

      target = Detection::MiniTest.testcase
      unless target < integration_module
        Debug.puts "Applying #{integration_module.description}"
        target.send(:include, integration_module)
      end
      true
    end

translate(exception) click to toggle source

    # File lib/mocha/integration/mini_test/exception_translation.rb, line 6
    def self.translate(exception)
      return exception unless exception.kind_of?(::Mocha::ExpectationError)
      translated_exception = ::MiniTest::Assertion.new(exception.message)
      translated_exception.set_backtrace(exception.backtrace)
      translated_exception
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.