Module: MiniTestPredicates::Unit

Defined in:
lib/minitest-predicates/core.rb

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(name, *args) ⇒ Object



61
62
63
64
65
66
67
68
# File 'lib/minitest-predicates/core.rb', line 61

def method_missing name, *args
  result = MiniTestPredicates.make_assertion! :name     => name,
                                              :object   => args.pop, 
                                              :args     => args,
                                              :positive => [/^assert_(.+)$/],
                                              :negative => [/^refute_(.+)$/]
  result == :super ? super : result
end