finapps 2.0.12 → 2.0.13
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.
- checksums.yaml +4 -4
- data/lib/finapps/rest/client.rb +1 -1
- data/lib/finapps/rest/resources.rb +1 -0
- data/lib/finapps/version.rb +1 -1
- data/spec/rest/orders_spec.rb +1 -1
- data/spec/rest/resources_spec.rb +5 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a2987098824b52fede2e1a57d407bc402a6811e6
|
4
|
+
data.tar.gz: ed685e787f5a304be08d50a13ccc79467b93380e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7efb0ddf292db6de0ed56592d88e691ba37bc704dfa4afa3eb2dea6144e23b73d697f4c4bbd8426fa6198a19ca947ec31f6a75faec05010f755d439b37c8db97
|
7
|
+
data.tar.gz: 935e7f9909363169f09717e1ab384a56ef34bbec5663aa9b64f0e00030b9ce2d2c4176c3f8af03e043e63f12e2195cc2ad62e89a5bd5e50d97c69c911ffd94ca
|
data/lib/finapps/rest/client.rb
CHANGED
@@ -11,7 +11,7 @@ module FinApps
|
|
11
11
|
# @param [String] tenant_token
|
12
12
|
# @param [Hash] options
|
13
13
|
# @return [FinApps::REST::Client]
|
14
|
-
def initialize(tenant_identifier, tenant_token,
|
14
|
+
def initialize(tenant_identifier, tenant_token, options={}, logger=nil)
|
15
15
|
raise FinApps::MissingArgumentsError.new 'Invalid company_identifier.' if tenant_identifier.blank?
|
16
16
|
raise FinApps::MissingArgumentsError.new 'Invalid company_token.' if tenant_token.blank?
|
17
17
|
|
@@ -10,6 +10,7 @@ module FinApps
|
|
10
10
|
# @return [FinApps::REST::Resources]
|
11
11
|
def initialize(client)
|
12
12
|
raise MissingArgumentsError.new 'Missing argument: client.' if client.nil?
|
13
|
+
raise InvalidArgumentsError.new 'Invalid argument: client.' unless client.is_a?(FinApps::REST::Client)
|
13
14
|
@client = client
|
14
15
|
end
|
15
16
|
|
data/lib/finapps/version.rb
CHANGED
data/spec/rest/orders_spec.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
RSpec.describe FinApps::REST::Orders do
|
3
3
|
describe '#show' do
|
4
|
-
let(:client) { FinApps::REST::Client.new
|
4
|
+
let(:client) { FinApps::REST::Client.new(:company_identifier, :company_token) }
|
5
5
|
|
6
6
|
context 'when missing params' do
|
7
7
|
subject { FinApps::REST::Orders.new(client).show(nil) }
|
data/spec/rest/resources_spec.rb
CHANGED
@@ -7,6 +7,11 @@ RSpec.describe FinApps::REST::Resources do
|
|
7
7
|
it { expect { subject }.to raise_error(FinApps::MissingArgumentsError, 'Missing argument: client.') }
|
8
8
|
end
|
9
9
|
|
10
|
+
context 'when client is not a FinApps::REST::Client object' do
|
11
|
+
subject { FinApps::REST::Resources.new(1) }
|
12
|
+
it { expect { subject }.to raise_error(FinApps::InvalidArgumentsError, 'Invalid argument: client.') }
|
13
|
+
end
|
14
|
+
|
10
15
|
context 'when client param is set' do
|
11
16
|
subject { FinApps::REST::Resources.new(client) }
|
12
17
|
it { expect { subject }.not_to raise_error }
|