Class: RR::Integrations::MiniTest4ActiveSupport
- Inherits:
-
Object
- Object
- RR::Integrations::MiniTest4ActiveSupport
- Defined in:
- lib/rr/integrations/minitest_4_active_support.rb
Direct Known Subclasses
Instance Method Summary collapse
- #applies? ⇒ Boolean
- #hook ⇒ Object
-
#initialize ⇒ MiniTest4ActiveSupport
constructor
A new instance of MiniTest4ActiveSupport.
- #name ⇒ Object
- #parent_adapter_class ⇒ Object
Constructor Details
#initialize ⇒ MiniTest4ActiveSupport
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
16 17 18 |
# File 'lib/rr/integrations/minitest_4_active_support.rb', line 16 def applies? @mt_adapter.applies? && defined?(::ActiveSupport::TestCase) end |
#hook ⇒ Object
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 |
#name ⇒ Object
12 13 14 |
# File 'lib/rr/integrations/minitest_4_active_support.rb', line 12 def name 'MiniTest 4 + ActiveSupport' end |
#parent_adapter_class ⇒ Object
8 9 10 |
# File 'lib/rr/integrations/minitest_4_active_support.rb', line 8 def parent_adapter_class MiniTest4 end |