Integrates Mocha into recent versions of Test::Unit.
See the source code for an example of how to integrate Mocha into a test library.
@private
# File lib/mocha/integration/test_unit/adapter.rb, line 16 def self.applicable_to?(test_unit_version, ruby_version = nil) Gem::Requirement.new('>= 2.5.1').satisfied_by?(test_unit_version) end
@private
# File lib/mocha/integration/test_unit/adapter.rb, line 21 def self.description "adapter for Test::Unit gem >= v2.5.1" end
@private
# File lib/mocha/integration/test_unit/adapter.rb, line 26 def self.included(mod) mod.setup :mocha_setup, :before => :prepend mod.exception_handler(:handle_mocha_expectation_error) mod.cleanup :after => :append do assertion_counter = Integration::AssertionCounter.new(self) mocha_verify(assertion_counter) end mod.teardown :mocha_teardown, :after => :append end
Generated with the Darkfish Rdoc Generator 2.