Deprecation for ruby 2.4 removed
Secondary credit: camelmasa <camelmasa@gmail.com>
This commit is contained in:
parent
b310986f9a
commit
03a1d21380
|
@ -269,7 +269,7 @@ module Shoulda
|
|||
# @private
|
||||
class ValidateInclusionOfMatcher < ValidationMatcher
|
||||
ARBITRARY_OUTSIDE_STRING = 'shoulda-matchers test string'
|
||||
ARBITRARY_OUTSIDE_FIXNUM = 123456789
|
||||
ARBITRARY_OUTSIDE_INTEGER = 123456789
|
||||
ARBITRARY_OUTSIDE_DECIMAL = BigDecimal.new('0.123456789')
|
||||
ARBITRARY_OUTSIDE_DATE = Date.jd(9999999)
|
||||
ARBITRARY_OUTSIDE_DATETIME = DateTime.jd(9999999)
|
||||
|
@ -483,8 +483,8 @@ EOT
|
|||
case attribute_type
|
||||
when :boolean
|
||||
boolean_outside_values
|
||||
when :fixnum
|
||||
[ARBITRARY_OUTSIDE_FIXNUM]
|
||||
when :integer
|
||||
[ARBITRARY_OUTSIDE_INTEGER]
|
||||
when :decimal
|
||||
[ARBITRARY_OUTSIDE_DECIMAL]
|
||||
when :date
|
||||
|
@ -538,7 +538,7 @@ EOT
|
|||
|
||||
def column_type_to_attribute_type(type)
|
||||
case type
|
||||
when :integer, :float then :fixnum
|
||||
when :float then :integer
|
||||
when :timestamp then :datetime
|
||||
else type
|
||||
end
|
||||
|
@ -548,7 +548,7 @@ EOT
|
|||
case value
|
||||
when true, false then :boolean
|
||||
when BigDecimal then :decimal
|
||||
when Integer then :fixnum
|
||||
when Integer then :integer
|
||||
when Date then :date
|
||||
when DateTime then :datetime
|
||||
when Time then :time
|
||||
|
|
|
@ -25,7 +25,7 @@ describe Shoulda::Matchers::ActiveModel::ValidateInclusionOfMatcher, type: :mode
|
|||
it_behaves_like 'it supports in_array',
|
||||
possible_values: (1..5).to_a,
|
||||
zero: 0,
|
||||
reserved_outside_value: described_class::ARBITRARY_OUTSIDE_FIXNUM
|
||||
reserved_outside_value: described_class::ARBITRARY_OUTSIDE_INTEGER
|
||||
|
||||
it_behaves_like 'it supports in_range',
|
||||
possible_values: 1..5,
|
||||
|
@ -82,7 +82,7 @@ describe Shoulda::Matchers::ActiveModel::ValidateInclusionOfMatcher, type: :mode
|
|||
it_behaves_like 'it supports in_array',
|
||||
possible_values: [1.0, 2.0, 3.0, 4.0, 5.0],
|
||||
zero: 0.0,
|
||||
reserved_outside_value: described_class::ARBITRARY_OUTSIDE_FIXNUM
|
||||
reserved_outside_value: described_class::ARBITRARY_OUTSIDE_INTEGER
|
||||
|
||||
it_behaves_like 'it supports in_range',
|
||||
possible_values: 1.0..5.0,
|
||||
|
|
Loading…
Reference in New Issue