rspec-protobuf 0.2.1 → 0.2.3

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
2
  SHA256:
3
- metadata.gz: e02818bd754dbc93cdd721fd59642c53c442b50d23a351adb44eb0df3df146d9
4
- data.tar.gz: e913a28c47e0280252f0eaf8a14f66ba16dcceb94de25d4cd227bc51ef40dbdf
3
+ metadata.gz: 329f818e153685d7b3c9295ca051543fe6915f9277478576892152359ebd6498
4
+ data.tar.gz: 8b79e6616adac2977f473aac8e7dab6f12efd343b2e2f9af987e597a2ee166dc
5
5
  SHA512:
6
- metadata.gz: 9b8b8a507e7074155239ee294f122812c28d9575131f93a79315caa44b2b2aab26c931a696da3c17fb1a0491f7755e1a050067277fd24dbd20df206e1ee48da3
7
- data.tar.gz: 65da298087c49ae41d64c8fa280418666a926abe904d89bb0045785bbed4070abd8a27be13e13e6842b5e706cadd89cd2719bcfb0c5c198a2ec1c24a2d3eb2c6
6
+ metadata.gz: 6597c162046f769e115efbfe4f1a83b027e1d27bf850873c97df598073707156773cd05a61ff771e6e4c626eac182403a21b8c47878adb53663b1da042599de5
7
+ data.tar.gz: 83458a56e5694c6766c99b4f86ab1eb63b2871adb2c9e559cc1bd045c85855f6fd1629aca670089dd11dbf5b0462bae27da2d000248d0f8ff9c2f7d56570e387
data/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ ### v0.2.3 (2023-03-14)
2
+ - repeated fields
3
+
4
+ ### v0.2.2 (2022-12-15)
5
+ - dependabot and lockfile
6
+ - simplify dependencies
7
+
1
8
  ### v0.2.1 (2022-11-16)
2
9
  - fix enum matching
3
10
 
data/Gemfile.lock ADDED
@@ -0,0 +1,48 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ rspec-protobuf (0.2.3)
5
+ google-protobuf (>= 3)
6
+ rspec-expectations (>= 3)
7
+
8
+ GEM
9
+ remote: https://rubygems.org/
10
+ specs:
11
+ byebug (11.1.3)
12
+ codecov (0.6.0)
13
+ simplecov (>= 0.15, < 0.22)
14
+ diff-lcs (1.5.0)
15
+ docile (1.4.0)
16
+ google-protobuf (3.22.2)
17
+ rspec (3.12.0)
18
+ rspec-core (~> 3.12.0)
19
+ rspec-expectations (~> 3.12.0)
20
+ rspec-mocks (~> 3.12.0)
21
+ rspec-core (3.12.0)
22
+ rspec-support (~> 3.12.0)
23
+ rspec-expectations (3.12.0)
24
+ diff-lcs (>= 1.2.0, < 2.0)
25
+ rspec-support (~> 3.12.0)
26
+ rspec-mocks (3.12.1)
27
+ diff-lcs (>= 1.2.0, < 2.0)
28
+ rspec-support (~> 3.12.0)
29
+ rspec-support (3.12.0)
30
+ simplecov (0.21.2)
31
+ docile (~> 1.1)
32
+ simplecov-html (~> 0.11)
33
+ simplecov_json_formatter (~> 0.1)
34
+ simplecov-html (0.12.3)
35
+ simplecov_json_formatter (0.1.4)
36
+
37
+ PLATFORMS
38
+ ruby
39
+
40
+ DEPENDENCIES
41
+ byebug
42
+ codecov
43
+ rspec (>= 3)
44
+ rspec-protobuf!
45
+ simplecov
46
+
47
+ BUNDLED WITH
48
+ 2.3.17
@@ -50,8 +50,10 @@ module RSpec
50
50
  if actual_value.is_a?(Google::Protobuf::MessageExts) && expected_value.is_a?(Hash)
51
51
  actual_value.match?(**expected_value)
52
52
  else
53
- # fall back to default value
54
- expected_value = field.default unless attrs.key?(field.name.to_sym)
53
+ unless attrs.key?(field.name.to_sym)
54
+ # fall back to default value
55
+ expected_value = field.label == :repeated ? [] : field.default
56
+ end
55
57
 
56
58
  # convert enum to int value to match input type
57
59
  if field.type == :enum && expected_value.is_a?(Integer)
@@ -74,7 +76,8 @@ module RSpec
74
76
  value = value.normalized_hash
75
77
  end
76
78
 
77
- res[field.name.to_sym] = value unless field.default == value
79
+ default = field.label == :repeated ? [] : field.default
80
+ res[field.name.to_sym] = value unless default == value
78
81
  end
79
82
 
80
83
  res
@@ -1,5 +1,5 @@
1
1
  module RSpec
2
2
  module Protobuf
3
- VERSION = "0.2.1"
3
+ VERSION = "0.2.3"
4
4
  end
5
5
  end
@@ -1,5 +1,5 @@
1
1
  require "google/protobuf"
2
- require "rspec"
2
+ require "rspec/expectations"
3
3
  require "rspec/protobuf/refinements"
4
4
  require "rspec/protobuf/version"
5
5
 
@@ -15,9 +15,10 @@ Gem::Specification.new do |s|
15
15
  s.files = `git ls-files * ':!:spec'`.split("\n")
16
16
 
17
17
  s.add_dependency "google-protobuf", ">= 3"
18
- s.add_dependency "rspec", ">= 3"
18
+ s.add_dependency "rspec-expectations", ">= 3"
19
19
 
20
20
  s.add_development_dependency "byebug"
21
21
  s.add_development_dependency "codecov"
22
+ s.add_development_dependency "rspec", ">= 3"
22
23
  s.add_development_dependency "simplecov"
23
24
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rspec-protobuf
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Pepper
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-11-17 00:00:00.000000000 Z
11
+ date: 2023-03-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: google-protobuf
@@ -25,7 +25,7 @@ dependencies:
25
25
  - !ruby/object:Gem::Version
26
26
  version: '3'
27
27
  - !ruby/object:Gem::Dependency
28
- name: rspec
28
+ name: rspec-expectations
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - ">="
@@ -66,6 +66,20 @@ dependencies:
66
66
  - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: rspec
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '3'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '3'
69
83
  - !ruby/object:Gem::Dependency
70
84
  name: simplecov
71
85
  requirement: !ruby/object:Gem::Requirement
@@ -88,6 +102,7 @@ extra_rdoc_files: []
88
102
  files:
89
103
  - CHANGELOG.md
90
104
  - Gemfile
105
+ - Gemfile.lock
91
106
  - LICENSE.txt
92
107
  - README.md
93
108
  - lib/rspec-protobuf.rb