Class: Peck::Should
- Inherits:
-
Object
- Object
- Peck::Should
- Defined in:
- lib/peck_on_rails.rb,
lib/peck_on_rails.rb
Defined Under Namespace
Classes: Disallow, RequireLogin, Response, ResponseRequirement, Specification
Instance Method Summary collapse
Instance Method Details
#validate_with(attribute, value) ⇒ Object
390 391 392 393 394 395 396 397 398 399 400 |
# File 'lib/peck_on_rails.rb', line 390 def validate_with(attribute, value) = "Expected #{!@negated ? 'no' : ''}errors on #{attribute.inspect} with value `#{value.inspect}' after validation" @this.send("#{attribute}=", value) @this.valid? if @this.errors[attribute].kind_of?(Array) satisfy() { @this.errors[attribute].empty? } else satisfy() { @this.errors[attribute].nil? } end end |