moneta-api 1.2.1 → 1.3.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2e92e0d5a7a3af600a1c1777150f2fd6777af4b7
4
- data.tar.gz: e56309db5f4fafeafc665a57166e9e58fc71e3d5
3
+ metadata.gz: 5012255105136dc8f2a655efffbc6a6ef84832a9
4
+ data.tar.gz: 740f600718fe957194fff2d74ca9c0e320d20ed6
5
5
  SHA512:
6
- metadata.gz: c5d2200ff1adf0036fa7aaad6882a5022adb20b8b19f64570040bfa2d2a1403b22391afb53baccc10f9e8d79f1b01a03368a1588b5d66cc76f5e4e5defd6f065
7
- data.tar.gz: a3ed5d84cffe25b0f1bd60bfd3d5d1ce4027c88913c11c00f385e59e22a7cbadf2b27d564698e4b240d0587549fddacb495a01d14f27567497e0777190dfcac5
6
+ metadata.gz: a7367a4b1e5a0d916cf97dba6210cf61e61b6f9cc4a0709451632972089bbd325199e730334cff8506a01807193c3c25b45fa5a9256103a51d420b0f9e42d933
7
+ data.tar.gz: ca54d82ef5ceb8e8e91f962d6357b5d1cfcb72bc546596cf884455680b04a466a155bb56ddee81d013b3cd40f1772f79258e445ace25499e19b97c6921c2870b
@@ -0,0 +1,5 @@
1
+ module Moneta
2
+ module Api
3
+ class RuntimeException < StandardError; end
4
+ end
5
+ end
@@ -185,6 +185,8 @@ module Moneta
185
185
  })
186
186
 
187
187
  ResponseFactory.build(response)
188
+ rescue Savon::SOAPFault => e
189
+ raise Moneta::Api::RuntimeException.new(e.message)
188
190
  end
189
191
 
190
192
  def validate!(method, request)
@@ -1,5 +1,5 @@
1
1
  module Moneta
2
2
  module Api
3
- VERSION = '1.2.1'
3
+ VERSION = '1.3.0'
4
4
  end
5
5
  end
data/lib/moneta/api.rb CHANGED
@@ -6,6 +6,7 @@ require 'moneta/api/service_methods'
6
6
  require 'moneta/api/service'
7
7
  require 'moneta/api/data_mapper'
8
8
  require 'moneta/api/key_value_serializer'
9
+ require 'moneta/api/runtime_exception'
9
10
 
10
11
  require 'moneta/api/types/account_access_info'
11
12
  require 'moneta/api/types/account_info'
@@ -3,9 +3,19 @@ describe Moneta::Api::Service do
3
3
  let(:service) { described_class.new($username, $password, params) }
4
4
 
5
5
  describe '#find_account_by_id', vcr: true do
6
- subject { service.find_account_by_id(10999) }
6
+ subject { service.find_account_by_id(account_id) }
7
7
 
8
- its('account.id') { is_expected.to eq '10999' }
8
+ context 'when success response' do
9
+ let(:account_id) { 10999 }
10
+
11
+ its('account.id') { is_expected.to eq '10999' }
12
+ end
13
+
14
+ context 'when soap raise error' do
15
+ let(:account_id) { -1 }
16
+
17
+ it { expect { subject }.to raise_exception(Moneta::Api::RuntimeException, '(SOAP-ENV:Client) Validation error') }
18
+ end
9
19
  end
10
20
 
11
21
  describe 'wsdl url' do