class Object
Public Instance Methods
assert_not_nil!()
click to toggle source
# File lib/code-assertions.rb, line 45 def assert_not_nil! assert("The result cannot be `nil` or `false`.") { self } self end
Also aliased as: assert_nn!
assert_type!(type)
click to toggle source
# File lib/code-assertions.rb, line 52 def assert_type!(type) assert("`type` should be an instance of `Class`") { type.is_a?(Class) } assert("Wrong type: expected #{type.name}, given #{self.class.name}") { self.is_a?(type) } self end