From 01974185a1640ed869417131d062b5a2eef620bc Mon Sep 17 00:00:00 2001 From: Robert Speicher Date: Wed, 19 Sep 2012 12:14:42 -0400 Subject: [PATCH] Simplify is_within matcher [ci skip] --- spec/support/matchers.rb | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/spec/support/matchers.rb b/spec/support/matchers.rb index cb1dcba3..809453c4 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