diff options
| author | Robert Speicher <rspeicher@gmail.com> | 2012-09-19 12:14:42 -0400 |
|---|---|---|
| committer | Robert Speicher <rspeicher@gmail.com> | 2012-09-19 12:14:42 -0400 |
| commit | 01974185a1640ed869417131d062b5a2eef620bc (patch) | |
| tree | 817489429a44a23ba0f5b9ba34c3d27427734679 /spec/support | |
| parent | bf625b7c92d5f07516339f53fdf391185df8547c (diff) | |
| download | gitlab-ce-01974185a1640ed869417131d062b5a2eef620bc.tar.gz | |
Simplify is_within matcher
[ci skip]
Diffstat (limited to 'spec/support')
| -rw-r--r-- | spec/support/matchers.rb | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/spec/support/matchers.rb b/spec/support/matchers.rb index cb1dcba3dd8..809453c4a3b 100644 --- a/spec/support/matchers.rb +++ b/spec/support/matchers.rb @@ -73,11 +73,7 @@ module Shoulda::Matchers::ActiveModel class EnsureLengthOfMatcher # Shortcut for is_at_least and is_at_most def is_within(range) - if range.exclude_end? - is_at_least(range.first) && is_at_most(range.last - 1) - else - is_at_least(range.first) && is_at_most(range.last) - end + is_at_least(range.min) && is_at_most(range.max) end end end |
