shoulda-matchers 3.1.2 → 3.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.travis.yml +1 -0
- data/NEWS.md +7 -0
- data/gemfiles/4.0.0.gemfile.lock +1 -1
- data/gemfiles/4.0.1.gemfile.lock +1 -1
- data/gemfiles/4.1.gemfile.lock +1 -1
- data/gemfiles/4.2.gemfile.lock +1 -1
- data/lib/shoulda/matchers/active_model/validate_absence_of_matcher.rb +1 -1
- data/lib/shoulda/matchers/active_model/validate_inclusion_of_matcher.rb +1 -1
- data/lib/shoulda/matchers/version.rb +1 -1
- data/spec/unit/shoulda/matchers/active_model/validate_inclusion_of_matcher_spec.rb +6 -6
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 53f6d57668b2c4f65787cf1eea63889b83ae9d3201d9dbe84603b051faddf0e6
|
4
|
+
data.tar.gz: 87cceafbe6b98f156f95bb458580ed8f2ee77b4b989f99b57142e43fb7d0d44b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: de3671526d4a72ad816c3e4628e5ac9412bc6a858f7dcf42028d0f24480675ef835d4b2313ecf9b5fedb628cf60354206fdb2f16d7663c975efa6cab29479dd0
|
7
|
+
data.tar.gz: 916de2f2ecf31d9f44390708acb91ef033b67bc020eb464512a81f4bbe2e4f7ca8edd49ff2610079e47ec0ef5ce601ef553b81d7eacb0645d280b99901eab7d7
|
data/.travis.yml
CHANGED
data/NEWS.md
CHANGED
data/gemfiles/4.0.0.gemfile.lock
CHANGED
data/gemfiles/4.0.1.gemfile.lock
CHANGED
data/gemfiles/4.1.gemfile.lock
CHANGED
data/gemfiles/4.2.gemfile.lock
CHANGED
@@ -105,7 +105,7 @@ module Shoulda
|
|
105
105
|
else
|
106
106
|
case column_type
|
107
107
|
when :integer, :float then 1
|
108
|
-
when :decimal then BigDecimal
|
108
|
+
when :decimal then BigDecimal(1, 0)
|
109
109
|
when :datetime, :time, :timestamp then Time.now
|
110
110
|
when :date then Date.new
|
111
111
|
when :binary then '0'
|
@@ -270,7 +270,7 @@ module Shoulda
|
|
270
270
|
class ValidateInclusionOfMatcher < ValidationMatcher
|
271
271
|
ARBITRARY_OUTSIDE_STRING = 'shoulda-matchers test string'
|
272
272
|
ARBITRARY_OUTSIDE_FIXNUM = 123456789
|
273
|
-
ARBITRARY_OUTSIDE_DECIMAL = BigDecimal
|
273
|
+
ARBITRARY_OUTSIDE_DECIMAL = BigDecimal('0.123456789')
|
274
274
|
ARBITRARY_OUTSIDE_DATE = Date.jd(9999999)
|
275
275
|
ARBITRARY_OUTSIDE_DATETIME = DateTime.jd(9999999)
|
276
276
|
ARBITRARY_OUTSIDE_TIME = Time.at(9999999999)
|
@@ -107,18 +107,18 @@ describe Shoulda::Matchers::ActiveModel::ValidateInclusionOfMatcher, type: :mode
|
|
107
107
|
context 'against a decimal attribute' do
|
108
108
|
it_behaves_like 'it supports in_array',
|
109
109
|
possible_values: [1.0, 2.0, 3.0, 4.0, 5.0].map { |number|
|
110
|
-
BigDecimal
|
110
|
+
BigDecimal(number.to_s)
|
111
111
|
},
|
112
|
-
zero: BigDecimal
|
112
|
+
zero: BigDecimal('0.0'),
|
113
113
|
reserved_outside_value: described_class::ARBITRARY_OUTSIDE_DECIMAL
|
114
114
|
|
115
115
|
it_behaves_like 'it supports in_range',
|
116
|
-
possible_values: BigDecimal
|
117
|
-
zero: BigDecimal
|
116
|
+
possible_values: BigDecimal('1.0') .. BigDecimal('5.0'),
|
117
|
+
zero: BigDecimal('0.0')
|
118
118
|
|
119
119
|
def build_object(options = {}, &block)
|
120
120
|
build_object_with_generic_attribute(
|
121
|
-
options.merge(column_type: :decimal, value: BigDecimal
|
121
|
+
options.merge(column_type: :decimal, value: BigDecimal('1.0')),
|
122
122
|
&block
|
123
123
|
)
|
124
124
|
end
|
@@ -130,7 +130,7 @@ describe Shoulda::Matchers::ActiveModel::ValidateInclusionOfMatcher, type: :mode
|
|
130
130
|
def validation_matcher_scenario_args
|
131
131
|
super.deep_merge(
|
132
132
|
column_type: :decimal,
|
133
|
-
default_value: BigDecimal
|
133
|
+
default_value: BigDecimal('1.0')
|
134
134
|
)
|
135
135
|
end
|
136
136
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: shoulda-matchers
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.1.
|
4
|
+
version: 3.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tammer Saleh
|
@@ -14,7 +14,7 @@ authors:
|
|
14
14
|
autorequire:
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
|
-
date:
|
17
|
+
date: 2019-01-28 00:00:00.000000000 Z
|
18
18
|
dependencies:
|
19
19
|
- !ruby/object:Gem::Dependency
|
20
20
|
name: activesupport
|
@@ -366,7 +366,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
366
366
|
version: '0'
|
367
367
|
requirements: []
|
368
368
|
rubyforge_project:
|
369
|
-
rubygems_version: 2.6
|
369
|
+
rubygems_version: 2.7.6
|
370
370
|
signing_key:
|
371
371
|
specification_version: 4
|
372
372
|
summary: Making tests easy on the fingers and eyes
|