Move custom matchers to their own files under spec/support/matchers
This commit is contained in:
parent
ff8811c40b
commit
0d5cf111f3
|
@ -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
|
|
@ -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
|
Loading…
Reference in New Issue