shoulda-matchers 4.1.2 → 4.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/MIT-LICENSE +1 -1
- data/README.md +2 -2
- data/lib/shoulda/matchers/active_model/allow_value_matcher.rb +2 -2
- data/lib/shoulda/matchers/active_record/association_matcher.rb +3 -3
- data/lib/shoulda/matchers/active_record/have_db_column_matcher.rb +1 -1
- data/lib/shoulda/matchers/rails_shim.rb +1 -18
- data/lib/shoulda/matchers/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 153f24e7ae0c3f3e4cc672663e3b718d15c5c1c809c6bab7ff3b418038b4ba71
|
4
|
+
data.tar.gz: 88ceb4268aa3cb820661e0ec4c41b04e1affedf68917e809f0e7fa33aff8d634
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2acfc2606814dada7608e2fe9f3fec032493ee316ebfeaeb94cb0c9d47fca23b702f5e54f4c74356a78bf952eb6cc8c42c74636a9b01201afe69a6c56504a8b7
|
7
|
+
data.tar.gz: c8db9ff17937194f55950b34cb56a6a71f922634dda173aad454e26915096b3201696b09ff75fe323034922a5d40b3d88a538365f9a58e8a6628e72ecf2855cb
|
data/MIT-LICENSE
CHANGED
data/README.md
CHANGED
@@ -19,7 +19,7 @@ complex, and error-prone.
|
|
19
19
|
|
20
20
|
## Quick links
|
21
21
|
|
22
|
-
📖 **[Read the documentation for the latest version
|
22
|
+
📖 **[Read the documentation for the latest version][rubydocs].**
|
23
23
|
📢 **[See what's changed in a recent version][news].**
|
24
24
|
|
25
25
|
[rubydocs]: http://matchers.shoulda.io/docs
|
@@ -406,7 +406,7 @@ Shoulda Matchers follows Semantic Versioning 2.0 as defined at
|
|
406
406
|
|
407
407
|
## License
|
408
408
|
|
409
|
-
Shoulda Matchers is copyright © 2006-
|
409
|
+
Shoulda Matchers is copyright © 2006-2020
|
410
410
|
[thoughtbot, inc][thoughtbot-website]. It is free software,
|
411
411
|
and may be redistributed under the terms specified in the
|
412
412
|
[MIT-LICENSE](MIT-LICENSE) file.
|
@@ -41,7 +41,7 @@ module Shoulda
|
|
41
41
|
# end
|
42
42
|
#
|
43
43
|
# it do
|
44
|
-
# should_not allow_values('
|
44
|
+
# should_not allow_values('foo', 'buz').
|
45
45
|
# for(:website_url)
|
46
46
|
# end
|
47
47
|
# end
|
@@ -51,7 +51,7 @@ module Shoulda
|
|
51
51
|
# should allow_values('http://foo.com', 'http://bar.com/baz').
|
52
52
|
# for(:website_url)
|
53
53
|
#
|
54
|
-
# should_not allow_values('
|
54
|
+
# should_not allow_values('foo', 'buz').
|
55
55
|
# for(:website_url)
|
56
56
|
# end
|
57
57
|
#
|
@@ -1096,12 +1096,12 @@ module Shoulda
|
|
1096
1096
|
self
|
1097
1097
|
end
|
1098
1098
|
|
1099
|
-
def optional
|
1099
|
+
def optional(optional = true)
|
1100
1100
|
remove_submatcher(AssociationMatchers::RequiredMatcher)
|
1101
1101
|
add_submatcher(
|
1102
1102
|
AssociationMatchers::OptionalMatcher,
|
1103
1103
|
name,
|
1104
|
-
|
1104
|
+
optional,
|
1105
1105
|
)
|
1106
1106
|
self
|
1107
1107
|
end
|
@@ -1394,7 +1394,7 @@ module Shoulda
|
|
1394
1394
|
end
|
1395
1395
|
|
1396
1396
|
def foreign_key_reflection
|
1397
|
-
if [:has_one, :has_many].include?(macro) && reflection.options.include?(:inverse_of)
|
1397
|
+
if [:has_one, :has_many].include?(macro) && reflection.options.include?(:inverse_of) && reflection.options[:inverse_of] != false
|
1398
1398
|
associated_class.reflect_on_association(reflection.options[:inverse_of])
|
1399
1399
|
else
|
1400
1400
|
reflection
|
@@ -3,10 +3,6 @@ module Shoulda
|
|
3
3
|
# @private
|
4
4
|
module RailsShim
|
5
5
|
class << self
|
6
|
-
def action_pack_gte_4_1?
|
7
|
-
Gem::Requirement.new('>= 4.1').satisfied_by?(action_pack_version)
|
8
|
-
end
|
9
|
-
|
10
6
|
def action_pack_gte_5?
|
11
7
|
Gem::Requirement.new('>= 5').satisfied_by?(action_pack_version)
|
12
8
|
end
|
@@ -85,15 +81,6 @@ module Shoulda
|
|
85
81
|
serialized_attributes_for(model)[attribute_name.to_s]
|
86
82
|
end
|
87
83
|
|
88
|
-
def type_cast_default_for(model, column)
|
89
|
-
if model.respond_to?(:column_defaults)
|
90
|
-
# Rails 4.2
|
91
|
-
model.column_defaults[column.name]
|
92
|
-
else
|
93
|
-
column.default
|
94
|
-
end
|
95
|
-
end
|
96
|
-
|
97
84
|
def tables_and_views(connection)
|
98
85
|
if active_record_gte_5?
|
99
86
|
connection.data_sources
|
@@ -103,11 +90,7 @@ module Shoulda
|
|
103
90
|
end
|
104
91
|
|
105
92
|
def verb_for_update
|
106
|
-
|
107
|
-
:patch
|
108
|
-
else
|
109
|
-
:put
|
110
|
-
end
|
93
|
+
:patch
|
111
94
|
end
|
112
95
|
|
113
96
|
def validation_message_key_for_association_required_option
|
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: 4.
|
4
|
+
version: 4.2.0
|
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: 2020-01-08 00:00:00.000000000 Z
|
18
18
|
dependencies:
|
19
19
|
- !ruby/object:Gem::Dependency
|
20
20
|
name: activesupport
|