Parent

Class/Module Index [+]

Quicksearch

RR::Integrations::TestUnit1

Public Instance Methods

applies?() click to toggle source
# File lib/rr/integrations/test_unit_1.rb, line 14
def applies?
  defined?(::Test::Unit) && !has_test_unit_version?
end
hook(test_case_class = ::Test::Unit::TestCase) click to toggle source
# File lib/rr/integrations/test_unit_1.rb, line 18
def hook(test_case_class = ::Test::Unit::TestCase)
  test_case_class.class_eval do
    include RR::Adapters::RRMethods
    include Mixin

    unless instance_methods.detect {|method_name| method_name.to_sym == :setup_with_rr }
      alias_method :setup_without_rr, :setup
      def setup_with_rr
        setup_without_rr
        RR.reset
        RR.trim_backtrace = true
        RR.overridden_error_class = ::Test::Unit::AssertionFailedError
      end
      alias_method :setup, :setup_with_rr

      alias_method :teardown_without_rr, :teardown
      def teardown_with_rr
        RR.verify
      ensure
        teardown_without_rr
      end
      alias_method :teardown, :teardown_with_rr
    end
  end
end
name() click to toggle source
# File lib/rr/integrations/test_unit_1.rb, line 10
def name
  'Test::Unit 1'
end
setup_with_rr() click to toggle source
# File lib/rr/integrations/test_unit_1.rb, line 25
def setup_with_rr
  setup_without_rr
  RR.reset
  RR.trim_backtrace = true
  RR.overridden_error_class = ::Test::Unit::AssertionFailedError
end
teardown_with_rr() click to toggle source
# File lib/rr/integrations/test_unit_1.rb, line 34
def teardown_with_rr
  RR.verify
ensure
  teardown_without_rr
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.