Class: Module

Inherits:
Object show all
Defined in:
lib/minitest/spec.rb

Overview

:nodoc:

Instance Method Summary collapse

Instance Method Details

#infect_an_assertion(meth, new_name, dont_flip = false) ⇒ Object

:nodoc:



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/minitest/spec.rb', line 6

def infect_an_assertion meth, new_name, dont_flip = false # :nodoc:
  # warn "%-22p -> %p %p" % [meth, new_name, dont_flip]
  self.class_eval "def \#{new_name} *args\ncase\nwhen Proc === self then\nMiniTest::Spec.current.\#{meth}(*args, &self)\nwhen \#{!!dont_flip} then\nMiniTest::Spec.current.\#{meth}(self, *args)\nelse\nMiniTest::Spec.current.\#{meth}(args.first, self, *args[1..-1])\nend\nend\n"
end

#infect_with_assertions(pos_prefix, neg_prefix, skip_re, dont_flip_re = /\c0/, map = {}) ⇒ Object

infect_with_assertions has been removed due to excessive clever. Use infect_an_assertion directly instead.



26
27
28
29
30
31
# File 'lib/minitest/spec.rb', line 26

def infect_with_assertions(pos_prefix, neg_prefix,
                           skip_re,
                           dont_flip_re = /\cc0/,
                           map = {})
  abort "infect_with_assertions is dead. Use infect_an_assertion directly"
end