Sha256: 5df68a7da992b169cc7c48439f0bac6b66482409f3e7a45240ecedd714b60e8a

Contents?: true

Size: 889 Bytes

Versions: 4

Compression:

Stored size: 889 Bytes

Contents

module RR
  module Integrations
    class MiniTest4ActiveSupport
      def initialize
        @mt_adapter = parent_adapter_class.new
      end

      def parent_adapter_class
        MiniTest4
      end

      def name
        'MiniTest 4 + ActiveSupport'
      end

      def applies?
        @mt_adapter.applies? && defined?(::ActiveSupport::TestCase)
      end

      def hook
        parent_adapter_class = self.parent_adapter_class
        ::ActiveSupport::TestCase.class_eval do
          include RR::Adapters::RRMethods
          include parent_adapter_class::Mixin

          setup do
            RR.reset
            RR.trim_backtrace = true
            RR.overridden_error_class = ::ActiveSupport::TestCase::Assertion
          end

          teardown do
            RR.verify
          end
        end
      end
    end

    RR.register_adapter MiniTest4ActiveSupport
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
rr-1.1.2 lib/rr/integrations/minitest_4_active_support.rb
rr-1.1.2.rc1 lib/rr/integrations/minitest_4_active_support.rb
rr-1.1.1 lib/rr/integrations/minitest_4_active_support.rb
rr-1.1.1.rc1 lib/rr/integrations/minitest_4_active_support.rb