patch_ruby 1.5.2 → 1.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,10 +1,4 @@
1
1
  RSpec.describe 'Preferences Integration' do
2
- before do
3
- Patch.configure do |config|
4
- config.access_token = ENV['SANDBOX_API_KEY']
5
- end
6
- end
7
-
8
2
  it 'supports create, delete, retrieve and list' do
9
3
  retrieve_projects_response = Patch::Project.retrieve_projects
10
4
  expect(retrieve_projects_response.data.length).not_to be_zero
@@ -1,8 +1,4 @@
1
1
  RSpec.describe 'Projects Integration' do
2
- Patch.configure do |config|
3
- config.access_token = ENV['SANDBOX_API_KEY']
4
- end
5
-
6
2
  it 'supports retrieve and list' do
7
3
  page_limit = 1
8
4
  next_page = 1
@@ -43,20 +39,12 @@ RSpec.describe 'Projects Integration' do
43
39
  end
44
40
 
45
41
  describe 'returned fields' do
46
- before do
47
- @project = Patch::Project.retrieve_projects(page: 1).data.first
48
- end
49
-
50
- it 'returns photos' do
51
- expect(@project.photos).to be_an_instance_of(Array)
52
- end
53
-
54
- it 'returns average_price_per_tonne_cents_usd' do
55
- expect(@project.average_price_per_tonne_cents_usd).to be_an_instance_of(Integer)
56
- end
42
+ it 'returns the expected fields' do
43
+ project = Patch::Project.retrieve_projects(page: 1).data.first
57
44
 
58
- it 'returns remaining_mass_g' do
59
- expect(@project.remaining_mass_g).to be_an_instance_of(Integer)
45
+ expect(project.photos).to be_an_instance_of(Array)
46
+ expect(project.average_price_per_tonne_cents_usd).to be_an_instance_of(Integer)
47
+ expect(project.remaining_mass_g).to be_an_instance_of(Integer)
60
48
  end
61
49
  end
62
50
  end
data/spec/spec_helper.rb CHANGED
@@ -41,6 +41,15 @@ RSpec.configure do |config|
41
41
  config.include FactoryBot::Syntax::Methods
42
42
  config.before(:suite) do
43
43
  FactoryBot.find_definitions
44
+ Patch.configure do |config|
45
+ if ENV.fetch('LOCAL_SDK_TEST', false)
46
+ config.access_token = ENV.fetch('LOCAL_PATCH_API_KEY')
47
+ config.scheme = 'http'
48
+ config.host = 'api.patch.test:3000'
49
+ else
50
+ config.access_token = ENV.fetch('SANDBOX_API_KEY')
51
+ end
52
+ end
44
53
  end
45
54
 
46
55
  # rspec-expectations config goes here. You can use an alternate
@@ -66,6 +75,12 @@ RSpec.configure do |config|
66
75
  mocks.verify_partial_doubles = true
67
76
  end
68
77
 
78
+ # Run specs in random order to surface order dependencies. If you find an
79
+ # order dependency and want to debug it, you can fix the order by providing
80
+ # the seed, which is printed after each run.
81
+ # --seed 1234
82
+ config.order = :random
83
+
69
84
  # The settings below are suggested to provide a good initial experience
70
85
  # with RSpec, but feel free to customize to your heart's content.
71
86
  =begin
@@ -107,12 +122,6 @@ RSpec.configure do |config|
107
122
  # particularly slow.
108
123
  config.profile_examples = 10
109
124
 
110
- # Run specs in random order to surface order dependencies. If you find an
111
- # order dependency and want to debug it, you can fix the order by providing
112
- # the seed, which is printed after each run.
113
- # --seed 1234
114
- config.order = :random
115
-
116
125
  # Seed global randomization in this process using the `--seed` CLI option.
117
126
  # Setting this allows you to use `--seed` to deterministically reproduce
118
127
  # test failures related to randomization by passing the same `--seed` value
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: patch_ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.2
4
+ version: 1.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Patch Technology
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-03-30 00:00:00.000000000 Z
11
+ date: 2021-08-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: typhoeus
@@ -83,7 +83,12 @@ files:
83
83
  - Makefile
84
84
  - README.md
85
85
  - Rakefile
86
+ - bin/rspec
86
87
  - lib/patch_ruby.rb
88
+ - lib/patch_ruby/.api_client.rb.un~
89
+ - lib/patch_ruby/.configuration.rb.un~
90
+ - lib/patch_ruby/.version.rb.un~
91
+ - lib/patch_ruby/api/.orders_api.rb.un~
87
92
  - lib/patch_ruby/api/estimates_api.rb
88
93
  - lib/patch_ruby/api/orders_api.rb
89
94
  - lib/patch_ruby/api/preferences_api.rb
@@ -91,7 +96,10 @@ files:
91
96
  - lib/patch_ruby/api_client.rb
92
97
  - lib/patch_ruby/api_error.rb
93
98
  - lib/patch_ruby/configuration.rb
99
+ - lib/patch_ruby/models/.create_ethereum_estimate_request.rb.un~
94
100
  - lib/patch_ruby/models/allocation.rb
101
+ - lib/patch_ruby/models/create_bitcoin_estimate_request.rb
102
+ - lib/patch_ruby/models/create_ethereum_estimate_request.rb
95
103
  - lib/patch_ruby/models/create_mass_estimate_request.rb
96
104
  - lib/patch_ruby/models/create_order_request.rb
97
105
  - lib/patch_ruby/models/create_preference_request.rb
@@ -114,6 +122,7 @@ files:
114
122
  - lib/patch_ruby/models/standard.rb
115
123
  - lib/patch_ruby/version.rb
116
124
  - patch_ruby.gemspec
125
+ - spec/.spec_helper.rb.un~
117
126
  - spec/api/estimates_api_spec.rb
118
127
  - spec/api/orders_api_spec.rb
119
128
  - spec/api/preferences_api_spec.rb
@@ -139,6 +148,10 @@ files:
139
148
  - spec/factories/project_list_responses.rb
140
149
  - spec/factories/project_responses.rb
141
150
  - spec/factories/projects.rb
151
+ - spec/integration/.estimates_spec.rb.un~
152
+ - spec/integration/.orders_spec.rb.un~
153
+ - spec/integration/.preferences_spec.rb.un~
154
+ - spec/integration/.projects_spec.rb.un~
142
155
  - spec/integration/estimates_spec.rb
143
156
  - spec/integration/orders_spec.rb
144
157
  - spec/integration/preferences_spec.rb
@@ -168,7 +181,7 @@ homepage: https://www.patch.io
168
181
  licenses:
169
182
  - MIT
170
183
  metadata: {}
171
- post_install_message:
184
+ post_install_message:
172
185
  rdoc_options: []
173
186
  require_paths:
174
187
  - lib
@@ -184,57 +197,61 @@ required_rubygems_version: !ruby/object:Gem::Requirement
184
197
  version: '0'
185
198
  requirements: []
186
199
  rubygems_version: 3.1.2
187
- signing_key:
200
+ signing_key:
188
201
  specification_version: 4
189
202
  summary: Ruby wrapper for the Patch API
190
203
  test_files:
191
204
  - spec/api/preferences_api_spec.rb
205
+ - spec/api/orders_api_spec.rb
192
206
  - spec/api/estimates_api_spec.rb
193
207
  - spec/api/projects_api_spec.rb
194
- - spec/api/orders_api_spec.rb
195
208
  - spec/api_client_spec.rb
196
209
  - spec/configuration_spec.rb
197
210
  - spec/constants.rb
211
+ - spec/factories/preference_responses.rb
212
+ - spec/factories/meta_index_objects.rb
198
213
  - spec/factories/preference_list_responses.rb
199
- - spec/factories/order_responses.rb
214
+ - spec/factories/allocations.rb
215
+ - spec/factories/project_list_responses.rb
200
216
  - spec/factories/projects.rb
201
217
  - spec/factories/error_responses.rb
218
+ - spec/factories/create_mass_estimate_requests.rb
202
219
  - spec/factories/orders.rb
220
+ - spec/factories/preferences.rb
221
+ - spec/factories/create_preference_requests.rb
203
222
  - spec/factories/create_order_requests.rb
204
- - spec/factories/create_mass_estimate_requests.rb
205
223
  - spec/factories/project_responses.rb
206
224
  - spec/factories/estimate_list_responses.rb
207
225
  - spec/factories/order_list_responses.rb
208
- - spec/factories/create_preference_requests.rb
209
- - spec/factories/allocations.rb
210
- - spec/factories/preferences.rb
211
- - spec/factories/project_list_responses.rb
212
226
  - spec/factories/estimates.rb
213
- - spec/factories/preference_responses.rb
227
+ - spec/factories/order_responses.rb
214
228
  - spec/factories/estimate_responses.rb
215
- - spec/factories/meta_index_objects.rb
229
+ - spec/integration/.preferences_spec.rb.un~
216
230
  - spec/integration/estimates_spec.rb
217
- - spec/integration/orders_spec.rb
218
- - spec/integration/preferences_spec.rb
231
+ - spec/integration/.orders_spec.rb.un~
219
232
  - spec/integration/projects_spec.rb
220
- - spec/models/create_order_request_spec.rb
221
- - spec/models/create_mass_estimate_request_spec.rb
222
- - spec/models/order_spec.rb
223
- - spec/models/allocation_spec.rb
224
- - spec/models/order_list_response_spec.rb
225
- - spec/models/estimate_list_response_spec.rb
233
+ - spec/integration/.estimates_spec.rb.un~
234
+ - spec/integration/preferences_spec.rb
235
+ - spec/integration/orders_spec.rb
236
+ - spec/integration/.projects_spec.rb.un~
226
237
  - spec/models/error_response_spec.rb
227
- - spec/models/project_list_response_spec.rb
228
- - spec/models/preference_spec.rb
238
+ - spec/models/estimate_response_spec.rb
239
+ - spec/models/project_spec.rb
240
+ - spec/models/create_preference_request_spec.rb
229
241
  - spec/models/order_response_spec.rb
242
+ - spec/models/preference_spec.rb
243
+ - spec/models/project_list_response_spec.rb
244
+ - spec/models/estimate_list_response_spec.rb
230
245
  - spec/models/preference_list_response_spec.rb
231
- - spec/models/create_preference_request_spec.rb
232
- - spec/models/project_response_spec.rb
233
- - spec/models/estimate_spec.rb
234
246
  - spec/models/meta_index_object_spec.rb
247
+ - spec/models/create_order_request_spec.rb
248
+ - spec/models/order_spec.rb
235
249
  - spec/models/preference_response_spec.rb
236
- - spec/models/project_spec.rb
237
- - spec/models/estimate_response_spec.rb
250
+ - spec/models/project_response_spec.rb
251
+ - spec/models/estimate_spec.rb
252
+ - spec/models/allocation_spec.rb
253
+ - spec/models/order_list_response_spec.rb
254
+ - spec/models/create_mass_estimate_request_spec.rb
238
255
  - spec/patch_ruby_spec.rb
239
256
  - spec/spec_helper.rb
240
257
  - spec/support/shared/generated_classes.rb