public Method

SelectorAssertions.count_description(min, max)

There's no documentation for this item.

Source Code

# File action_controller/assertions/selector_assertions.rb, line 314
def count_description(min, max) #:nodoc:
  pluralize = lambda {|word, quantity| word << (quantity == 1 ? '' : 's')}

  if min && max && (max != min)
    "between #{min} and #{max} elements"
  elsif min && !(min == 1 && max == 1)
    "at least #{min} #{pluralize['element', min]}"
  elsif max
    "at most #{max} #{pluralize['element', max]}"
  end
end
Comments

Have your say
Please use Textile formatting (click here for a cheat sheet). Use <code/> and <pre/> for code samples.
Click here to login with OpenID to to post comments.