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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 892658d99508ced4e79d11b2b61897f7c795b381
4
- data.tar.gz: b839df6e00c6ad1720ed2a36fc53008c3fb9c6ed
3
+ metadata.gz: a2987098824b52fede2e1a57d407bc402a6811e6
4
+ data.tar.gz: ed685e787f5a304be08d50a13ccc79467b93380e
5
5
  SHA512:
6
- metadata.gz: cfa0c2e7fd724240be7ca119f996b70bb53bac454f21e1883b3a6b892e9ea628a0bc714c3eda3106a356aa69c01d6832f32dfd7b8f95880c478c32c923cfa9c8
7
- data.tar.gz: 96ad3e2ddd0d94b881bf604316ada36e8abad77eed58692a11a95fd350dd62f05482855a9b46b84ee55ce3d7d677e90113a3fd68bdaa7f8a3629319d6fa3c232
6
+ metadata.gz: 7efb0ddf292db6de0ed56592d88e691ba37bc704dfa4afa3eb2dea6144e23b73d697f4c4bbd8426fa6198a19ca947ec31f6a75faec05010f755d439b37c8db97
7
+ data.tar.gz: 935e7f9909363169f09717e1ab384a56ef34bbec5663aa9b64f0e00030b9ce2d2c4176c3f8af03e043e63f12e2195cc2ad62e89a5bd5e50d97c69c911ffd94ca
@@ -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, logger=nil, options={})
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
 
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module FinApps
3
- VERSION = '2.0.12'
3
+ VERSION = '2.0.13'
4
4
  end
@@ -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 :company_identifier, :company_token }
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) }
@@ -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 }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: finapps
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.12
4
+ version: 2.0.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Erich Quintero