finapps_core 5.0.7 → 5.0.8

Sign up to get free protection for your applications and to get access to all the features.
@@ -4,41 +4,48 @@ require 'finapps_core/error'
4
4
 
5
5
  RSpec.describe FinAppsCore::REST::Configuration do
6
6
  describe '#new' do
7
- context 'for invalid timeout configuration' do
8
- subject { FinAppsCore::REST::Configuration.new(timeout: 'whatever') }
7
+ context 'with invalid timeout configuration' do
8
+ subject(:configuration) { described_class.new(timeout: 'whatever') }
9
+
9
10
  expected_error = FinAppsCore::InvalidArgumentsError
10
- it { expect { subject }.to raise_error(expected_error, 'Invalid argument. {timeout: whatever}') }
11
+ it { expect { configuration }.to raise_error(expected_error, 'Invalid argument. {timeout: whatever}') }
11
12
  end
12
13
 
13
- context 'for missing timeout configuration' do
14
- subject { FinAppsCore::REST::Configuration.new(timeout: nil) }
15
- it 'should have a default timeout value' do
16
- expect(subject.timeout).to eq(FinAppsCore::REST::Defaults::DEFAULTS[:timeout])
14
+ context 'with missing timeout configuration' do
15
+ subject(:configuration) { described_class.new(timeout: nil) }
16
+
17
+ it 'has a default timeout value' do
18
+ expect(configuration.timeout).to eq(FinAppsCore::REST::Defaults::DEFAULTS[:timeout])
17
19
  end
18
20
  end
19
21
 
20
- context 'for invalid host configuration' do
21
- subject { FinAppsCore::REST::Configuration.new(host: 'whatever') }
22
+ context 'with invalid host configuration' do
23
+ subject(:configuration) { described_class.new(host: 'whatever') }
24
+
22
25
  expected_error = FinAppsCore::InvalidArgumentsError
23
- it { expect { subject }.to raise_error(expected_error, 'Invalid argument. {host: whatever}') }
26
+ it { expect { configuration }.to raise_error(expected_error, 'Invalid argument. {host: whatever}') }
24
27
  end
25
28
 
26
- context 'for missing host configuration' do
27
- subject { FinAppsCore::REST::Configuration.new(host: nil) }
28
- it 'should have a default host value' do
29
- expect(subject.host).to eq(FinAppsCore::REST::Defaults::DEFAULTS[:host])
29
+ context 'with missing host configuration' do
30
+ subject(:configuration) { described_class.new(host: nil) }
31
+
32
+ it 'has a default host value' do
33
+ expect(configuration.host).to eq(FinAppsCore::REST::Defaults::DEFAULTS[:host])
30
34
  end
31
35
  end
32
36
  end
33
37
 
34
38
  describe '#valid_user_credentials??' do
35
39
  context 'when user credentials were not set' do
36
- subject { FinAppsCore::REST::Configuration.new(host: nil) }
37
- it { expect(subject.valid_user_credentials?).to eq(false) }
40
+ subject(:configuration) { described_class.new(host: nil) }
41
+
42
+ it { expect(configuration.valid_user_credentials?).to eq(false) }
38
43
  end
44
+
39
45
  context 'when user credentials were set' do
40
- subject { FinAppsCore::REST::Configuration.new(user_identifier: 1, user_token: 2) }
41
- it { expect(subject.valid_user_credentials?).to eq(true) }
46
+ subject(:configuration) { described_class.new(user_identifier: 1, user_token: 2) }
47
+
48
+ it { expect(configuration.valid_user_credentials?).to eq(true) }
42
49
  end
43
50
  end
44
51
  end
@@ -3,19 +3,19 @@
3
3
  RSpec.describe FinAppsCore::REST::Credentials do
4
4
  describe '#valid?' do
5
5
  context 'when missing identifier' do
6
- it { expect(FinAppsCore::REST::Credentials.new(nil, :token).valid?).to eql(true) }
6
+ it { expect(described_class.new(nil, :token).valid?).to be(true) }
7
7
  end
8
8
 
9
9
  context 'when missing token' do
10
- it { expect(FinAppsCore::REST::Credentials.new(:identifier, nil).valid?).to eql(false) }
10
+ it { expect(described_class.new(:identifier, nil).valid?).to be(false) }
11
11
  end
12
12
 
13
13
  context 'when missing both identifier and token' do
14
- it { expect(FinAppsCore::REST::Credentials.new(nil, nil).valid?).to eql(false) }
14
+ it { expect(described_class.new(nil, nil).valid?).to be(false) }
15
15
  end
16
16
 
17
17
  context 'when having identifier and token' do
18
- it { expect(FinAppsCore::REST::Credentials.new(:identifier, :token).valid?).to eql(true) }
18
+ it { expect(described_class.new(:identifier, :token).valid?).to be(true) }
19
19
  end
20
20
  end
21
21
  end
@@ -12,6 +12,6 @@ RSpec.describe FinAppsCore::REST::Defaults do
12
12
  it('sets DEFAULTS[:host]') { expect(described_class::DEFAULTS[:host]).to eq 'https://api.finclear.io' }
13
13
  it('sets DEFAULTS[:timeout]') { expect(described_class::DEFAULTS[:timeout]).to eq 30 }
14
14
  it('does not set DEFAULTS[:proxy]') { expect(described_class::DEFAULTS[:proxy]).to be_nil }
15
- it('sets DEFAULTS[:log_level]') { expect(described_class::DEFAULTS[:log_level]).to eq Logger::INFO }
15
+ it('sets DEFAULTS[:log_level]') { expect(described_class::DEFAULTS[:log_level]).to eq Logger::UNKNOWN }
16
16
  end
17
17
  end
@@ -1,30 +1,20 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'spec_helpers/client'
4
-
5
3
  RSpec.describe FinAppsCore::REST::Resources do
6
- include SpecHelpers::Client
7
- subject { FinAppsCore::REST::Resources.new client }
8
-
9
4
  describe '#new' do
10
- context 'for a valid client param' do
11
- it { expect { subject }.not_to raise_error }
5
+ context 'with a valid client param' do
6
+ subject(:resources) { described_class.new :client }
7
+
8
+ it { expect { resources }.not_to raise_error }
12
9
  end
13
10
 
14
11
  context 'when missing client param' do
15
- subject { FinAppsCore::REST::Resources.new nil }
16
- it { expect { subject }.to raise_error(FinAppsCore::MissingArgumentsError) }
17
- end
18
- end
12
+ subject(:resources) { described_class.new nil }
19
13
 
20
- describe '#list' do
21
- end
22
- describe '#create' do
23
- end
24
- describe '#update' do
25
- end
26
- describe '#show' do
27
- end
28
- describe '#destroy' do
14
+ it {
15
+ expect { resources }
16
+ .to raise_error(FinAppsCore::MissingArgumentsError)
17
+ }
18
+ end
29
19
  end
30
20
  end
@@ -29,12 +29,12 @@ RSpec.configure do |config|
29
29
  config.warnings = true
30
30
  Kernel.srand config.seed
31
31
 
32
- config.before(:each) do
32
+ config.before do
33
33
  base_url = "#{FinAppsCore::REST::Defaults::DEFAULTS[:host]}/v#{FinAppsCore::REST::Defaults::API_VERSION}/"
34
34
  stub_request(:any, /#{base_url}/).to_rack(::FakeApi)
35
35
  end
36
36
  WebMock.disable_net_connect!(allow: 'codeclimate.com')
37
37
  end
38
38
 
39
- VALID_CREDENTIALS = { identifier: '49fb918d-7e71-44dd-7378-58f19606df2a',
40
- token: 'hohoho=' }.freeze
39
+ VALID_CREDENTIALS = {identifier: '49fb918d-7e71-44dd-7378-58f19606df2a',
40
+ token: 'hohoho='}.freeze
@@ -6,19 +6,20 @@ end
6
6
 
7
7
  RSpec.describe FinAppsCore::Utils::Validatable do
8
8
  describe '#not_blank' do
9
- context 'for null values' do
10
- it 'should raise FinAppsCore::MissingArgumentsError' do
11
- expect { FakeClass.new.not_blank(nil) }.to raise_error(FinAppsCore::MissingArgumentsError)
9
+ context 'with null values' do
10
+ it 'raises FinAppsCore::MissingArgumentsError' do
11
+ expect { FakeClass.new.not_blank(nil) }
12
+ .to raise_error(FinAppsCore::MissingArgumentsError)
12
13
  end
13
14
 
14
- it 'should describe the argument name when provided' do
15
- expect { FakeClass.new.not_blank(nil, :name) }.to raise_error(FinAppsCore::MissingArgumentsError,
16
- ': name')
15
+ it 'describes the argument name when provided' do
16
+ expect { FakeClass.new.not_blank(nil, :name) }
17
+ .to raise_error(FinAppsCore::MissingArgumentsError, ': name')
17
18
  end
18
19
  end
19
20
 
20
- context 'for non null values' do
21
- it 'should not raise' do
21
+ context 'with non null values' do
22
+ it 'does not raise' do
22
23
  expect { FakeClass.new.not_blank(true) }.not_to raise_error
23
24
  end
24
25
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: finapps_core
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.0.7
4
+ version: 5.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Erich Quintero
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-02-11 00:00:00.000000000 Z
11
+ date: 2020-06-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -116,100 +116,100 @@ dependencies:
116
116
  requirements:
117
117
  - - "~>"
118
118
  - !ruby/object:Gem::Version
119
- version: '12.3'
119
+ version: '13.0'
120
120
  - - ">="
121
121
  - !ruby/object:Gem::Version
122
- version: 12.3.2
122
+ version: 13.0.1
123
123
  type: :development
124
124
  prerelease: false
125
125
  version_requirements: !ruby/object:Gem::Requirement
126
126
  requirements:
127
127
  - - "~>"
128
128
  - !ruby/object:Gem::Version
129
- version: '12.3'
129
+ version: '13.0'
130
130
  - - ">="
131
131
  - !ruby/object:Gem::Version
132
- version: 12.3.2
132
+ version: 13.0.1
133
133
  - !ruby/object:Gem::Dependency
134
134
  name: rspec
135
135
  requirement: !ruby/object:Gem::Requirement
136
136
  requirements:
137
- - - ">="
138
- - !ruby/object:Gem::Version
139
- version: 3.8.0
140
137
  - - "~>"
141
138
  - !ruby/object:Gem::Version
142
139
  version: '3.8'
140
+ - - ">="
141
+ - !ruby/object:Gem::Version
142
+ version: 3.8.0
143
143
  type: :development
144
144
  prerelease: false
145
145
  version_requirements: !ruby/object:Gem::Requirement
146
146
  requirements:
147
- - - ">="
148
- - !ruby/object:Gem::Version
149
- version: 3.8.0
150
147
  - - "~>"
151
148
  - !ruby/object:Gem::Version
152
149
  version: '3.8'
150
+ - - ">="
151
+ - !ruby/object:Gem::Version
152
+ version: 3.8.0
153
153
  - !ruby/object:Gem::Dependency
154
154
  name: rubocop
155
155
  requirement: !ruby/object:Gem::Requirement
156
156
  requirements:
157
- - - ">="
158
- - !ruby/object:Gem::Version
159
- version: 0.75.0
160
157
  - - "~>"
161
158
  - !ruby/object:Gem::Version
162
- version: '0.75'
159
+ version: '0.86'
160
+ - - ">="
161
+ - !ruby/object:Gem::Version
162
+ version: 0.86.0
163
163
  type: :development
164
164
  prerelease: false
165
165
  version_requirements: !ruby/object:Gem::Requirement
166
166
  requirements:
167
- - - ">="
168
- - !ruby/object:Gem::Version
169
- version: 0.75.0
170
167
  - - "~>"
171
168
  - !ruby/object:Gem::Version
172
- version: '0.75'
169
+ version: '0.86'
170
+ - - ">="
171
+ - !ruby/object:Gem::Version
172
+ version: 0.86.0
173
173
  - !ruby/object:Gem::Dependency
174
174
  name: rubocop-performance
175
175
  requirement: !ruby/object:Gem::Requirement
176
176
  requirements:
177
- - - ">="
178
- - !ruby/object:Gem::Version
179
- version: 1.5.0
180
177
  - - "~>"
181
178
  - !ruby/object:Gem::Version
182
- version: '1.5'
179
+ version: '1.6'
180
+ - - ">="
181
+ - !ruby/object:Gem::Version
182
+ version: 1.6.1
183
183
  type: :development
184
184
  prerelease: false
185
185
  version_requirements: !ruby/object:Gem::Requirement
186
186
  requirements:
187
- - - ">="
188
- - !ruby/object:Gem::Version
189
- version: 1.5.0
190
187
  - - "~>"
191
188
  - !ruby/object:Gem::Version
192
- version: '1.5'
189
+ version: '1.6'
190
+ - - ">="
191
+ - !ruby/object:Gem::Version
192
+ version: 1.6.1
193
193
  - !ruby/object:Gem::Dependency
194
194
  name: rubocop-rspec
195
195
  requirement: !ruby/object:Gem::Requirement
196
196
  requirements:
197
- - - ">="
198
- - !ruby/object:Gem::Version
199
- version: 1.36.0
200
197
  - - "~>"
201
198
  - !ruby/object:Gem::Version
202
- version: '1.36'
199
+ version: '1.40'
200
+ - - ">="
201
+ - !ruby/object:Gem::Version
202
+ version: 1.40.0
203
203
  type: :development
204
204
  prerelease: false
205
205
  version_requirements: !ruby/object:Gem::Requirement
206
206
  requirements:
207
- - - ">="
208
- - !ruby/object:Gem::Version
209
- version: 1.36.0
210
207
  - - "~>"
211
208
  - !ruby/object:Gem::Version
212
- version: '1.36'
209
+ version: '1.40'
210
+ - - ">="
211
+ - !ruby/object:Gem::Version
212
+ version: 1.40.0
213
213
  - !ruby/object:Gem::Dependency
214
214
  name: sinatra
215
215
  requirement: !ruby/object:Gem::Requirement
@@ -234,22 +234,22 @@ dependencies:
234
234
  name: webmock
235
235
  requirement: !ruby/object:Gem::Requirement
236
236
  requirements:
237
- - - ">="
238
- - !ruby/object:Gem::Version
239
- version: 3.6.0
240
237
  - - "~>"
241
238
  - !ruby/object:Gem::Version
242
239
  version: '3.6'
240
+ - - ">="
241
+ - !ruby/object:Gem::Version
242
+ version: 3.6.0
243
243
  type: :development
244
244
  prerelease: false
245
245
  version_requirements: !ruby/object:Gem::Requirement
246
246
  requirements:
247
- - - ">="
248
- - !ruby/object:Gem::Version
249
- version: 3.6.0
250
247
  - - "~>"
251
248
  - !ruby/object:Gem::Version
252
249
  version: '3.6'
250
+ - - ">="
251
+ - !ruby/object:Gem::Version
252
+ version: 3.6.0
253
253
  description: A simple library for communicating with the FinApps REST API. Core functionality.
254
254
  email:
255
255
  - erich@financialapps.com
@@ -267,6 +267,7 @@ files:
267
267
  - ".rubocop.yml"
268
268
  - ".ruby-gemset"
269
269
  - ".ruby-version"
270
+ - ".tmuxinator.yml"
270
271
  - ".travis.yml"
271
272
  - Gemfile
272
273
  - LICENSE
@@ -344,25 +345,25 @@ required_rubygems_version: !ruby/object:Gem::Requirement
344
345
  - !ruby/object:Gem::Version
345
346
  version: '0'
346
347
  requirements: []
347
- rubygems_version: 3.0.6
348
+ rubygems_version: 3.1.3
348
349
  signing_key:
349
350
  specification_version: 4
350
351
  summary: FinApps REST API ruby client - Core.
351
352
  test_files:
352
- - spec/rest/defaults_spec.rb
353
- - spec/rest/base_client_spec.rb
354
- - spec/rest/credentials_spec.rb
355
- - spec/rest/configuration_spec.rb
356
- - spec/rest/resources_spec.rb
357
- - spec/support/fake_api.rb
358
- - spec/utils/validatable_spec.rb
359
- - spec/spec_helpers/client.rb
360
- - spec/spec_helper.rb
361
- - spec/core_extensions/object/is_integer_spec.rb
362
- - spec/middleware/request/no_encoding_basic_authentication_spec.rb
353
+ - spec/middleware/response/raise_error_spec.rb
363
354
  - spec/middleware/request/user_agent_spec.rb
355
+ - spec/middleware/request/request_id_spec.rb
364
356
  - spec/middleware/request/tenant_authentication_spec.rb
365
- - spec/middleware/request/x_consumer_id_spec.rb
366
357
  - spec/middleware/request/accept_json_spec.rb
367
- - spec/middleware/request/request_id_spec.rb
368
- - spec/middleware/response/raise_error_spec.rb
358
+ - spec/middleware/request/x_consumer_id_spec.rb
359
+ - spec/middleware/request/no_encoding_basic_authentication_spec.rb
360
+ - spec/spec_helper.rb
361
+ - spec/spec_helpers/client.rb
362
+ - spec/utils/validatable_spec.rb
363
+ - spec/support/fake_api.rb
364
+ - spec/core_extensions/object/is_integer_spec.rb
365
+ - spec/rest/credentials_spec.rb
366
+ - spec/rest/base_client_spec.rb
367
+ - spec/rest/configuration_spec.rb
368
+ - spec/rest/defaults_spec.rb
369
+ - spec/rest/resources_spec.rb