rspec-dry-struct 0.3.0 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: b8b896aa416e192b00b52bf624a86037ebfdcc8f
4
- data.tar.gz: 56d47138d4814ff4f1aa986a61cbd50e2622d2ba
2
+ SHA256:
3
+ metadata.gz: f38ccabc288f56d7173f46c1fc665b0d86286707381f0f2e3c2bc679c34bb682
4
+ data.tar.gz: 1469179551f6e6a1563a335f8cee230030aa7512c554630710b853c748aa90d9
5
5
  SHA512:
6
- metadata.gz: 1bdbc8e24c4fcec114025a7a437bdb98d457bdb3356b2b8e3afe806f80b70df59a45197e4b105b2382545b001e3996080473136422d12f0234063257532e1faa
7
- data.tar.gz: 12a3415403cdd5a3baad5a10939c9dbf84379df25730eb51f7609d167f3be7769b225535570fc6e685a05a709a44dc605a7e9c934c09bf5cee702c9be3b8ed18
6
+ metadata.gz: 6189a2a9309600751857481b06466e3e3dc6acd9f69fd8356080e2bdf12dc77ac609c587373a05d2d4fd6a0660ad6e26adea16852fc732e256eebdeb02bda132
7
+ data.tar.gz: 91f25841a7f0ae76fa7fc3f12ad03927cebfe4fb5dda94b490ab8efb8e407235b7d5457048b03337846e111ced95e63e1e2bb64e07ad3d82feb594900aaccb05
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/matic-insurance/rspec-dry-struct.
79
+ Bug reports and pull requests are welcome on GitHub at https://github.com/Kukunin/rspec-dry-struct.
80
80
 
@@ -11,8 +11,10 @@ module RSpec
11
11
 
12
12
  def matches?(actual)
13
13
  @actual = actual
14
- @actual_attribute = actual.schema[@attr_name]
15
- attr_present? && correct_attr_type?
14
+ @actual_attribute = actual.schema.key(@attr_name).type
15
+ correct_attr_type?
16
+ rescue KeyError
17
+ false
16
18
  end
17
19
 
18
20
  def description
@@ -30,10 +32,6 @@ module RSpec
30
32
 
31
33
  private
32
34
 
33
- def attr_present?
34
- !@actual_attribute.nil?
35
- end
36
-
37
35
  def correct_attr_type?
38
36
  @attr_type.nil? || @actual_attribute == @attr_type
39
37
  end
@@ -1,7 +1,7 @@
1
1
  module RSpec
2
2
  module Dry
3
3
  module Struct
4
- VERSION = '0.3.0'.freeze
4
+ VERSION = '0.4.0'.freeze
5
5
  end
6
6
  end
7
7
  end
@@ -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/matic-insurance/rspec-dry-struct'
14
+ spec.homepage = 'https://github.com/Kukunin/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)/})
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.3.0
4
+ version: 0.4.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: 2017-03-04 00:00:00.000000000 Z
11
+ date: 2019-07-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -101,7 +101,7 @@ files:
101
101
  - lib/rspec/dry/struct/matcher.rb
102
102
  - lib/rspec/dry/struct/version.rb
103
103
  - rspec-dry-struct.gemspec
104
- homepage: https://github.com/matic-insurance/rspec-dry-struct
104
+ homepage: https://github.com/Kukunin/rspec-dry-struct
105
105
  licenses: []
106
106
  metadata: {}
107
107
  post_install_message:
@@ -119,8 +119,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
119
119
  - !ruby/object:Gem::Version
120
120
  version: '0'
121
121
  requirements: []
122
- rubyforge_project:
123
- rubygems_version: 2.5.1
122
+ rubygems_version: 3.0.3
124
123
  signing_key:
125
124
  specification_version: 4
126
125
  summary: RSpec matcher for dry-struct gem