rspec-dry-struct 0.4.0 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/rspec/dry/struct/matcher.rb +10 -4
- data/lib/rspec/dry/struct/version.rb +1 -1
- data/rspec-dry-struct.gemspec +2 -1
- metadata +17 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a38aca21d268b46948b7a1df4da3373a7e24fd2b58efbb59bd1721cb0fae875a
|
4
|
+
data.tar.gz: 48b8b65549be390c7320d6719379d30a97f8a09c3c57c5d83b21ee249ca48ff9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5f960bee1582252848de5250b2f2d26f97f2967e161e57cfe89283bc41ff552a44b1ec8d5bc58470056aa15055f5f28ad8263a327628bc3a0d8d10a026fb1203
|
7
|
+
data.tar.gz: 0bcf65a2fe0fd2d6da8674a5a27a2533af0fecee5638238f77d451add49644663733ee26c52f69cce994950c747cbc522ed50fde6a76541514ce9c5e44e2e390
|
data/README.md
CHANGED
@@ -76,5 +76,5 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
76
76
|
|
77
77
|
## Contributing
|
78
78
|
|
79
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
79
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/matic-insurance/rspec-dry-struct.
|
80
80
|
|
@@ -11,10 +11,12 @@ module RSpec
|
|
11
11
|
|
12
12
|
def matches?(actual)
|
13
13
|
@actual = actual
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
14
|
+
attribute = actual.schema.find do |attr|
|
15
|
+
attr.name == @attr_name
|
16
|
+
end
|
17
|
+
@actual_attribute = attribute.type if attribute
|
18
|
+
|
19
|
+
attr_present? && correct_attr_type?
|
18
20
|
end
|
19
21
|
|
20
22
|
def description
|
@@ -32,6 +34,10 @@ module RSpec
|
|
32
34
|
|
33
35
|
private
|
34
36
|
|
37
|
+
def attr_present?
|
38
|
+
!@actual_attribute.nil?
|
39
|
+
end
|
40
|
+
|
35
41
|
def correct_attr_type?
|
36
42
|
@attr_type.nil? || @actual_attribute == @attr_type
|
37
43
|
end
|
data/rspec-dry-struct.gemspec
CHANGED
@@ -11,7 +11,7 @@ Gem::Specification.new do |spec|
|
|
11
11
|
|
12
12
|
spec.summary = 'RSpec matcher for dry-struct gem'
|
13
13
|
spec.description = 'RSpec `have_attribute` matcher for dry-struct gem'
|
14
|
-
spec.homepage = 'https://github.com/
|
14
|
+
spec.homepage = 'https://github.com/matic-insurance/rspec-dry-struct'
|
15
15
|
|
16
16
|
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
17
17
|
f.match(%r{^(test|spec|features)/})
|
@@ -22,6 +22,7 @@ Gem::Specification.new do |spec|
|
|
22
22
|
|
23
23
|
spec.add_runtime_dependency 'rspec'
|
24
24
|
spec.add_runtime_dependency 'dry-struct'
|
25
|
+
spec.add_runtime_dependency 'dry-types', '>= 0.15.0'
|
25
26
|
|
26
27
|
spec.add_development_dependency 'bundler'
|
27
28
|
spec.add_development_dependency 'rspec-its'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rspec-dry-struct
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sergey Kukunin
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-01-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -38,6 +38,20 @@ dependencies:
|
|
38
38
|
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: dry-types
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: 0.15.0
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 0.15.0
|
41
55
|
- !ruby/object:Gem::Dependency
|
42
56
|
name: bundler
|
43
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -101,7 +115,7 @@ files:
|
|
101
115
|
- lib/rspec/dry/struct/matcher.rb
|
102
116
|
- lib/rspec/dry/struct/version.rb
|
103
117
|
- rspec-dry-struct.gemspec
|
104
|
-
homepage: https://github.com/
|
118
|
+
homepage: https://github.com/matic-insurance/rspec-dry-struct
|
105
119
|
licenses: []
|
106
120
|
metadata: {}
|
107
121
|
post_install_message:
|