Commit 01974185a1640ed869417131d062b5a2eef620bc
1 parent
bf625b7c
Exists in
master
and in
4 other branches
Simplify is_within matcher
[ci skip]
Showing
1 changed file
with
1 additions
and
5 deletions
Show diff stats
spec/support/matchers.rb
| @@ -73,11 +73,7 @@ module Shoulda::Matchers::ActiveModel | @@ -73,11 +73,7 @@ module Shoulda::Matchers::ActiveModel | ||
| 73 | class EnsureLengthOfMatcher | 73 | class EnsureLengthOfMatcher |
| 74 | # Shortcut for is_at_least and is_at_most | 74 | # Shortcut for is_at_least and is_at_most |
| 75 | def is_within(range) | 75 | def is_within(range) |
| 76 | - if range.exclude_end? | ||
| 77 | - is_at_least(range.first) && is_at_most(range.last - 1) | ||
| 78 | - else | ||
| 79 | - is_at_least(range.first) && is_at_most(range.last) | ||
| 80 | - end | 76 | + is_at_least(range.min) && is_at_most(range.max) |
| 81 | end | 77 | end |
| 82 | end | 78 | end |
| 83 | end | 79 | end |