Sha256: c6dd6ab9db37ff3bdad360cf8ef1b4d0267f384e322eed5a3be79d9102ddd19c
Contents?: true
Size: 1.3 KB
Versions: 3
Compression:
Stored size: 1.3 KB
Contents
module RR module Integrations class TestUnit1 module Mixin def assert_received(subject, &block) block.call(received(subject)).call end end def name 'Test::Unit 1' end def applies? defined?(::Test::Unit) && !has_test_unit_version? end 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 private def has_test_unit_version? require 'test/unit/version' true rescue LoadError false end end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
rr-1.1.0 | lib/rr/integrations/test_unit_1.rb |
rr-1.1.0.rc3 | lib/rr/integrations/test_unit_1.rb |
rr-1.1.0.rc2 | lib/rr/integrations/test_unit_1.rb |