class Object

Public Instance Methods

assert_nn!()
Alias for: assert_not_nil!
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
Also aliased as: at!, is_a!
at!(type)
Alias for: assert_type!
is_a!(type)
Alias for: assert_type!