Class: RR::Integrations::MiniTest4ActiveSupport

Inherits:
Object
  • Object
show all
Defined in:
lib/rr/integrations/minitest_4_active_support.rb

Direct Known Subclasses

MinitestActiveSupport

Instance Method Summary collapse

Constructor Details

#initializeMiniTest4ActiveSupport

Returns a new instance of MiniTest4ActiveSupport.



4
5
6
# File 'lib/rr/integrations/minitest_4_active_support.rb', line 4

def initialize
  @mt_adapter = parent_adapter_class.new
end

Instance Method Details

#applies?Boolean

Returns:

  • (Boolean)


16
17
18
# File 'lib/rr/integrations/minitest_4_active_support.rb', line 16

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

#hookObject



20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/rr/integrations/minitest_4_active_support.rb', line 20

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

#nameObject



12
13
14
# File 'lib/rr/integrations/minitest_4_active_support.rb', line 12

def name
  'MiniTest 4 + ActiveSupport'
end

#parent_adapter_classObject



8
9
10
# File 'lib/rr/integrations/minitest_4_active_support.rb', line 8

def parent_adapter_class
  MiniTest4
end