Sha256: d0471c12976dfcd6cd312a46db82e1c67570e64d392265a3e0291a556909270a

Contents?: true

Size: 873 Bytes

Versions: 14

Compression:

Stored size: 873 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::DSL
          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

14 entries across 14 versions & 1 rubygems

Version Path
rr-3.1.1 lib/rr/integrations/minitest_4_active_support.rb
rr-3.1.0 lib/rr/integrations/minitest_4_active_support.rb
rr-3.0.9 lib/rr/integrations/minitest_4_active_support.rb
rr-3.0.8 lib/rr/integrations/minitest_4_active_support.rb
rr-3.0.7 lib/rr/integrations/minitest_4_active_support.rb
rr-3.0.6 lib/rr/integrations/minitest_4_active_support.rb
rr-3.0.5 lib/rr/integrations/minitest_4_active_support.rb
rr-3.0.4 lib/rr/integrations/minitest_4_active_support.rb
rr-3.0.3 lib/rr/integrations/minitest_4_active_support.rb
rr-3.0.2 lib/rr/integrations/minitest_4_active_support.rb
rr-3.0.1 lib/rr/integrations/minitest_4_active_support.rb
rr-3.0.0 lib/rr/integrations/minitest_4_active_support.rb
rr-1.2.1 lib/rr/integrations/minitest_4_active_support.rb
rr-1.2.0 lib/rr/integrations/minitest_4_active_support.rb