|
1 | 1 | require 'active_support/concern' |
2 | 2 |
|
3 | | -module CountDescribable |
4 | | - extend ActiveSupport::Concern |
| 3 | +module Rails |
| 4 | + module Dom |
| 5 | + module Testing |
| 6 | + module Assertions |
| 7 | + module SelectorAssertions |
| 8 | + module CountDescribable |
| 9 | + extend ActiveSupport::Concern |
5 | 10 |
|
6 | | - private |
7 | | - def count_description(min, max, count) #:nodoc: |
8 | | - if min && max && (max != min) |
9 | | - "between #{min} and #{max} elements" |
10 | | - elsif min && max && max == min && count |
11 | | - "exactly #{count} #{pluralize_element(min)}" |
12 | | - elsif min && !(min == 1 && max == 1) |
13 | | - "at least #{min} #{pluralize_element(min)}" |
14 | | - elsif max |
15 | | - "at most #{max} #{pluralize_element(max)}" |
16 | | - end |
17 | | - end |
| 11 | + private |
| 12 | + def count_description(min, max, count) #:nodoc: |
| 13 | + if min && max && (max != min) |
| 14 | + "between #{min} and #{max} elements" |
| 15 | + elsif min && max && max == min && count |
| 16 | + "exactly #{count} #{pluralize_element(min)}" |
| 17 | + elsif min && !(min == 1 && max == 1) |
| 18 | + "at least #{min} #{pluralize_element(min)}" |
| 19 | + elsif max |
| 20 | + "at most #{max} #{pluralize_element(max)}" |
| 21 | + end |
| 22 | + end |
18 | 23 |
|
19 | | - def pluralize_element(quantity) |
20 | | - quantity == 1 ? 'element' : 'elements' |
| 24 | + def pluralize_element(quantity) |
| 25 | + quantity == 1 ? 'element' : 'elements' |
| 26 | + end |
| 27 | + end |
| 28 | + end |
| 29 | + end |
21 | 30 | end |
| 31 | + end |
22 | 32 | end |
0 commit comments