Method: Mini::Assertions#assert_kind_of

Defined in:
lib/mini/test.rb

#assert_kind_of(cls, obj, msg = nil) ⇒ Object

TODO: merge with instance_of



97
98
99
100
101
102
# File 'lib/mini/test.rb', line 97

def assert_kind_of cls, obj, msg = nil # TODO: merge with instance_of
  msg = message msg, "Expected #{mu_pp(obj)} to be a kind of #{cls}"
  flip = (Module === obj) && ! (Module === cls) # HACK for specs
  obj, cls = cls, obj if flip
  assert obj.kind_of?(cls), msg
end