Move custom matchers to their own files under spec/support/matchers

This commit is contained in:
Robert Speicher 2015-07-21 22:09:58 -04:00
parent ff8811c40b
commit 0d5cf111f3
2 changed files with 9 additions and 10 deletions

View File

@ -11,13 +11,3 @@ RSpec::Matchers.define :include_module do |expected|
"expected #{described_class} to include the #{expected} module"
end
end
# Extend shoulda-matchers
module Shoulda::Matchers::ActiveModel
class ValidateLengthOfMatcher
# Shortcut for is_at_least and is_at_most
def is_within(range)
is_at_least(range.min) && is_at_most(range.max)
end
end
end

View File

@ -0,0 +1,9 @@
# Extend shoulda-matchers
module Shoulda::Matchers::ActiveModel
class ValidateLengthOfMatcher
# Shortcut for is_at_least and is_at_most
def is_within(range)
is_at_least(range.min) && is_at_most(range.max)
end
end
end