Class: Pippi::Checks::AssertWithNil

Inherits:
Check
  • Object
show all
Defined in:
lib/pippi/checks/assert_with_nil.rb

Defined Under Namespace

Modules: MyAssertEqual Classes: Documentation

Instance Attribute Summary

Attributes inherited from Check

#ctx

Instance Method Summary collapse

Methods inherited from Check

#add_problem, #clear_fault, #clear_fault_proc, #initialize, #its_ok_watcher_proc, #method_names_that_indicate_this_is_being_used_as_a_collection, #mutator_methods

Constructor Details

This class inherits a constructor from Pippi::Checks::Check

Instance Method Details

#decorateObject



12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/pippi/checks/assert_with_nil.rb', line 12

def decorate
  if defined?(ActiveSupport::TestCase)
    ActiveSupport::TestCase.class_exec(self) do |my_check|
      @_pippi_check_assert_with_nil = my_check
      def self._pippi_other_check_assert_with_nil
        @_pippi_check_assert_with_nil
      end
      def self._pippi_check_assert_with_nil
        ancestors.find { |x| x == ActiveSupport::TestCase }._pippi_other_check_assert_with_nil
      end
      prepend Pippi::Checks::AssertWithNil::MyAssertEqual
    end
  end
end