Parent

Shoulda::Matchers::ActiveModel::ComparisonMatcher

Examples:

it { should validate_numericality_of(:attr).
              is_greater_than(6).
              less_than(20)...(and so on) }

Public Class Methods

new(value, operator) click to toggle source
# File lib/shoulda/matchers/active_model/comparison_matcher.rb, line 9
def initialize(value, operator)
  @value = value
  @operator = operator
end

Public Instance Methods

allowed_types() click to toggle source
# File lib/shoulda/matchers/active_model/comparison_matcher.rb, line 24
def allowed_types
  'integer'
end
for(attribute) click to toggle source
# File lib/shoulda/matchers/active_model/comparison_matcher.rb, line 14
def for(attribute)
  @attribute = attribute
  self
end
matches?(subject) click to toggle source
# File lib/shoulda/matchers/active_model/comparison_matcher.rb, line 19
def matches?(subject)
  @subject = subject
  disallows_value_of(value_to_compare)
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.