nulogy_graphql_api 4.1.0 → 4.2.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
2
  SHA256:
3
- metadata.gz: e5df22536e696922579485014185d836121aa098afc60af021145dbd448c4950
4
- data.tar.gz: baa28072000c782dea03575731a953de6b2473dfd50d09ee681849c0295bdac2
3
+ metadata.gz: cb4868df494a1562cf1cd29d3d0f631a10ad40435f9bc77df9219c5d6c184c39
4
+ data.tar.gz: 5e0e650c1d9c7b5860b06d3f0926b6306a14112f02d371a72bc4f89eb47732cf
5
5
  SHA512:
6
- metadata.gz: 5b4450d8522bb45ed1408acc116e3a817e1962e057d25e617241fce82248c95f8dece65736d0d177141019c9a3683cc7d72e67a6b9b932ae342f9d5240138dc3
7
- data.tar.gz: 7632b36bcd21830c6e6a8390b484838bdddbec73cb4dd9bf35e7b1bbb981bd830a410cc6038fc34131e080df19c1f8ba3d7f7b58a97bf834c1938394d3fc9212
6
+ metadata.gz: 9c953d2c7ccdca7e22d956b59bdb8a29141a462da4aaee138ef1d99db8ad4a8bfff80cd55a80da496d7bce9cce0a4fedfba713fd681fbce52dfc3812ea954727
7
+ data.tar.gz: e42c4ca54ca019f3ee9bc48661b09e9fe0b38c318644930ab8ae376a46f4a0b67c6021d4eb529d4652c6d8b6e380fcfc3a3d18aa80e12ac2264d502086512961
data/.rubocop.yml CHANGED
@@ -1,7 +1,9 @@
1
1
  require:
2
2
  - rubocop-performance
3
+ - rubocop-rails
3
4
  - rubocop-rake
4
5
  - rubocop-rspec
6
+ - rubocop-rspec_rails
5
7
 
6
8
  inherit_from:
7
9
  - .rubocop.directories.yml
@@ -114,6 +116,9 @@ Lint/UnmodifiedReduceAccumulator:
114
116
  Metrics:
115
117
  Enabled: false
116
118
 
119
+ Rails/Output:
120
+ Enabled: false
121
+
117
122
  RSpec/AnyInstance:
118
123
  Enabled: false
119
124
 
data/Appraisals CHANGED
@@ -1,7 +1,3 @@
1
- appraise "rails-6-1" do
2
- gem "rails", "6.1.4"
3
- end
4
-
5
1
  appraise "rails-7-0" do
6
2
  gem "rails", "7.0.8.6"
7
3
  gem "sprockets-rails", "3.5.2"
@@ -11,3 +7,8 @@ appraise "rails-7-1" do
11
7
  gem "rails", "7.1.4.2"
12
8
  gem "sprockets-rails", "3.5.2"
13
9
  end
10
+
11
+ appraise "rails-7-2" do
12
+ gem "rails", "7.2.1.2"
13
+ gem "sprockets-rails", "3.5.2"
14
+ end
data/CHANGELOG.md CHANGED
@@ -4,6 +4,11 @@
4
4
 
5
5
  _none_
6
6
 
7
+ ## 4.2.0 (2024-10-28)
8
+
9
+ * Drop support for Rails 6.1
10
+ * Revert change to `have_graphql_data` RSpec matcher
11
+
7
12
  ## 4.1.0 (2024-10-25)
8
13
 
9
14
  * Add support for Rails 7.1
@@ -2,6 +2,7 @@
2
2
 
3
3
  source "https://rubygems.org"
4
4
 
5
- gem "rails", "6.1.4"
5
+ gem "rails", "7.2.1.2"
6
+ gem "sprockets-rails", "3.5.2"
6
7
 
7
8
  gemspec path: "../"
@@ -4,72 +4,43 @@ require "rspec/expectations"
4
4
  module NulogyGraphqlApi
5
5
  module GraphqlMatchers
6
6
  RSpec::Matchers.define :have_graphql_data do |expected_data|
7
- match do |actual_data|
8
- # Allow the expected data to be passed without the root :data key.
9
- @actual = actual_data[:data]
10
- @expected = expected_data
11
-
12
- deep_match(@expected, @actual)
7
+ match do |graphql_response|
8
+ @expected_response = { data: expected_data }
9
+ expect(graphql_response).to match(@expected_response)
13
10
  end
14
11
 
15
- diffable
16
-
17
- failure_message do
18
- "Expected GraphQL data to match (ignoring array ordering) but found differences."
19
- end
20
-
21
- failure_message_when_negated do
22
- "Expected GraphQL data not to match (ignoring array ordering) but found no differences."
23
- end
12
+ failure_message do |actual_response|
13
+ <<~MSG
14
+ expected: #{@expected_response.pretty_inspect}
24
15
 
25
- def actual
26
- @actual
27
- end
28
-
29
- def expected
30
- @expected
31
- end
32
-
33
- def deep_match(expected, actual)
34
- case expected
35
- when Hash
36
- return false unless actual.is_a?(Hash) && expected.keys.sort == actual.keys.sort
37
-
38
- expected.all? { |key, value| deep_match(value, actual[key]) }
39
- when Array
40
- return false unless actual.is_a?(Array) && expected.size == actual.size
41
-
42
- # Sort both arrays before comparing them element by element.
43
- expected.sort_by(&:to_s) == actual.sort_by(&:to_s)
44
- else
45
- expected == actual
46
- end
16
+ got: #{actual_response.pretty_inspect}
17
+ MSG
47
18
  end
48
19
  end
49
- end
50
20
 
51
- RSpec::Matchers.define :have_graphql_error do |message|
52
- match do |actual_response|
53
- expect(actual_response.fetch(:errors, nil)).to contain_exactly(a_hash_including(
54
- message: include(message)
55
- ))
21
+ RSpec::Matchers.define :have_graphql_error do |message|
22
+ match do |actual_response|
23
+ expect(actual_response.fetch(:errors, nil)).to contain_exactly(a_hash_including(
24
+ message: include(message)
25
+ ))
26
+ end
56
27
  end
57
- end
58
28
 
59
- RSpec::Matchers.define :have_network_error do |message, error_extensions = {}|
60
- match do |actual_response|
61
- expect(actual_response).to match({
62
- data: {},
63
- errors: [{ message: message }.merge(error_extensions)]
64
- })
29
+ RSpec::Matchers.define :have_network_error do |message, error_extensions = {}|
30
+ match do |actual_response|
31
+ expect(actual_response).to match({
32
+ data: {},
33
+ errors: [{ message: message }.merge(error_extensions)]
34
+ })
35
+ end
65
36
  end
66
- end
67
37
 
68
- RSpec::Matchers.define :include_graphql_error do |message|
69
- match do |actual_response|
70
- expect(actual_response.fetch(:errors, nil)).to include(a_hash_including(
71
- message: include(message)
72
- ))
38
+ RSpec::Matchers.define :include_graphql_error do |message|
39
+ match do |actual_response|
40
+ expect(actual_response.fetch(:errors, nil)).to include(a_hash_including(
41
+ message: include(message)
42
+ ))
43
+ end
73
44
  end
74
45
  end
75
46
  end
@@ -1,3 +1,3 @@
1
1
  module NulogyGraphqlApi
2
- VERSION = "4.1.0"
2
+ VERSION = "4.2.0"
3
3
  end
@@ -29,18 +29,20 @@ Gem::Specification.new do |spec|
29
29
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
30
30
  spec.require_paths = ["lib"]
31
31
 
32
- spec.add_dependency "graphql", "~> 2"
32
+ spec.add_dependency "graphql", "~> 2.3"
33
33
  spec.add_dependency "graphql-schema_comparator", "~> 1.2"
34
- spec.add_dependency "rails", ">= 6.1", "< 8.0"
35
- spec.add_dependency "rainbow", "~> 3.0"
34
+ spec.add_dependency "rails", ">= 7.0", "< 8.0"
35
+ spec.add_dependency "rainbow", "~> 3.1"
36
36
 
37
37
  spec.add_development_dependency "appraisal", "~> 2.5"
38
- spec.add_development_dependency "rake", "~> 13.1"
39
- spec.add_development_dependency "rspec", "~> 3.12"
40
- spec.add_development_dependency "rspec-rails", "~> 5.1"
41
- spec.add_development_dependency "rubocop", "~> 1.25"
42
- spec.add_development_dependency "rubocop-performance", "~> 1.13"
38
+ spec.add_development_dependency "rake", "~> 13.2"
39
+ spec.add_development_dependency "rspec", "~> 3.13"
40
+ spec.add_development_dependency "rspec-rails", ">= 6.1"
41
+ spec.add_development_dependency "rubocop", "~> 1.67"
42
+ spec.add_development_dependency "rubocop-performance", "~> 1.22"
43
+ spec.add_development_dependency "rubocop-rails", "~> 2.26"
43
44
  spec.add_development_dependency "rubocop-rake", "~> 0.6"
44
- spec.add_development_dependency "rubocop-rspec", "~> 2.8"
45
+ spec.add_development_dependency "rubocop-rspec", "~> 3.1"
46
+ spec.add_development_dependency "rubocop-rspec_rails", "~> 2.3"
45
47
  spec.add_development_dependency "sqlite3", "~> 1.4"
46
48
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nulogy_graphql_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.1.0
4
+ version: 4.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Silva
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-10-25 00:00:00.000000000 Z
11
+ date: 2024-10-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: graphql
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '2'
19
+ version: '2.3'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '2'
26
+ version: '2.3'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: graphql-schema_comparator
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -44,7 +44,7 @@ dependencies:
44
44
  requirements:
45
45
  - - ">="
46
46
  - !ruby/object:Gem::Version
47
- version: '6.1'
47
+ version: '7.0'
48
48
  - - "<"
49
49
  - !ruby/object:Gem::Version
50
50
  version: '8.0'
@@ -54,7 +54,7 @@ dependencies:
54
54
  requirements:
55
55
  - - ">="
56
56
  - !ruby/object:Gem::Version
57
- version: '6.1'
57
+ version: '7.0'
58
58
  - - "<"
59
59
  - !ruby/object:Gem::Version
60
60
  version: '8.0'
@@ -64,14 +64,14 @@ dependencies:
64
64
  requirements:
65
65
  - - "~>"
66
66
  - !ruby/object:Gem::Version
67
- version: '3.0'
67
+ version: '3.1'
68
68
  type: :runtime
69
69
  prerelease: false
70
70
  version_requirements: !ruby/object:Gem::Requirement
71
71
  requirements:
72
72
  - - "~>"
73
73
  - !ruby/object:Gem::Version
74
- version: '3.0'
74
+ version: '3.1'
75
75
  - !ruby/object:Gem::Dependency
76
76
  name: appraisal
77
77
  requirement: !ruby/object:Gem::Requirement
@@ -92,70 +92,84 @@ dependencies:
92
92
  requirements:
93
93
  - - "~>"
94
94
  - !ruby/object:Gem::Version
95
- version: '13.1'
95
+ version: '13.2'
96
96
  type: :development
97
97
  prerelease: false
98
98
  version_requirements: !ruby/object:Gem::Requirement
99
99
  requirements:
100
100
  - - "~>"
101
101
  - !ruby/object:Gem::Version
102
- version: '13.1'
102
+ version: '13.2'
103
103
  - !ruby/object:Gem::Dependency
104
104
  name: rspec
105
105
  requirement: !ruby/object:Gem::Requirement
106
106
  requirements:
107
107
  - - "~>"
108
108
  - !ruby/object:Gem::Version
109
- version: '3.12'
109
+ version: '3.13'
110
110
  type: :development
111
111
  prerelease: false
112
112
  version_requirements: !ruby/object:Gem::Requirement
113
113
  requirements:
114
114
  - - "~>"
115
115
  - !ruby/object:Gem::Version
116
- version: '3.12'
116
+ version: '3.13'
117
117
  - !ruby/object:Gem::Dependency
118
118
  name: rspec-rails
119
119
  requirement: !ruby/object:Gem::Requirement
120
120
  requirements:
121
- - - "~>"
121
+ - - ">="
122
122
  - !ruby/object:Gem::Version
123
- version: '5.1'
123
+ version: '6.1'
124
124
  type: :development
125
125
  prerelease: false
126
126
  version_requirements: !ruby/object:Gem::Requirement
127
127
  requirements:
128
- - - "~>"
128
+ - - ">="
129
129
  - !ruby/object:Gem::Version
130
- version: '5.1'
130
+ version: '6.1'
131
131
  - !ruby/object:Gem::Dependency
132
132
  name: rubocop
133
133
  requirement: !ruby/object:Gem::Requirement
134
134
  requirements:
135
135
  - - "~>"
136
136
  - !ruby/object:Gem::Version
137
- version: '1.25'
137
+ version: '1.67'
138
138
  type: :development
139
139
  prerelease: false
140
140
  version_requirements: !ruby/object:Gem::Requirement
141
141
  requirements:
142
142
  - - "~>"
143
143
  - !ruby/object:Gem::Version
144
- version: '1.25'
144
+ version: '1.67'
145
145
  - !ruby/object:Gem::Dependency
146
146
  name: rubocop-performance
147
147
  requirement: !ruby/object:Gem::Requirement
148
148
  requirements:
149
149
  - - "~>"
150
150
  - !ruby/object:Gem::Version
151
- version: '1.13'
151
+ version: '1.22'
152
+ type: :development
153
+ prerelease: false
154
+ version_requirements: !ruby/object:Gem::Requirement
155
+ requirements:
156
+ - - "~>"
157
+ - !ruby/object:Gem::Version
158
+ version: '1.22'
159
+ - !ruby/object:Gem::Dependency
160
+ name: rubocop-rails
161
+ requirement: !ruby/object:Gem::Requirement
162
+ requirements:
163
+ - - "~>"
164
+ - !ruby/object:Gem::Version
165
+ version: '2.26'
152
166
  type: :development
153
167
  prerelease: false
154
168
  version_requirements: !ruby/object:Gem::Requirement
155
169
  requirements:
156
170
  - - "~>"
157
171
  - !ruby/object:Gem::Version
158
- version: '1.13'
172
+ version: '2.26'
159
173
  - !ruby/object:Gem::Dependency
160
174
  name: rubocop-rake
161
175
  requirement: !ruby/object:Gem::Requirement
@@ -176,14 +190,28 @@ dependencies:
176
190
  requirements:
177
191
  - - "~>"
178
192
  - !ruby/object:Gem::Version
179
- version: '2.8'
193
+ version: '3.1'
194
+ type: :development
195
+ prerelease: false
196
+ version_requirements: !ruby/object:Gem::Requirement
197
+ requirements:
198
+ - - "~>"
199
+ - !ruby/object:Gem::Version
200
+ version: '3.1'
201
+ - !ruby/object:Gem::Dependency
202
+ name: rubocop-rspec_rails
203
+ requirement: !ruby/object:Gem::Requirement
204
+ requirements:
205
+ - - "~>"
206
+ - !ruby/object:Gem::Version
207
+ version: '2.3'
180
208
  type: :development
181
209
  prerelease: false
182
210
  version_requirements: !ruby/object:Gem::Requirement
183
211
  requirements:
184
212
  - - "~>"
185
213
  - !ruby/object:Gem::Version
186
- version: '2.8'
214
+ version: '2.3'
187
215
  - !ruby/object:Gem::Dependency
188
216
  name: sqlite3
189
217
  requirement: !ruby/object:Gem::Requirement
@@ -223,9 +251,9 @@ files:
223
251
  - Rakefile
224
252
  - bin/console
225
253
  - bin/setup
226
- - gemfiles/rails_6_1.gemfile
227
254
  - gemfiles/rails_7_0.gemfile
228
255
  - gemfiles/rails_7_1.gemfile
256
+ - gemfiles/rails_7_2.gemfile
229
257
  - lib/nulogy_graphql_api.rb
230
258
  - lib/nulogy_graphql_api/error_handling.rb
231
259
  - lib/nulogy_graphql_api/graphql_error.rb