class Oval::InstanceOf

Public Instance Methods

it_should() click to toggle source
# File lib/oval/instance_of.rb, line 11
def it_should
  "be an instance of #{klass.name}"
end
validate(object, subject = nil) click to toggle source
# File lib/oval/instance_of.rb, line 4
def validate(object, subject = nil)
  unless object.instance_of?(klass)
    raise Oval::ValueError,
      "Invalid object #{object.inspect} of type #{object.class.name}" +
      "#{for_subject(subject)}. Should be an instance of #{klass.name}"
  end
end