soap_adapters 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2d6dbef0b4e53fcddce347f22e0b380d4dce45cc
4
- data.tar.gz: bc80a049c96f79b9b19332ddfaa17add4e46393f
3
+ metadata.gz: 6c96d60694be86688e4a945c9e61c54e104eb629
4
+ data.tar.gz: acc171b1065992da4f525c3d3b45b3d5b4cfbecc
5
5
  SHA512:
6
- metadata.gz: 6034c0105099ebfa33131795c142133ed8027dacbef2e32dfa9ac4608feee5602eaa458f37e3665c939bbf08b163f7b08d544017fb39f6e97be54dd561359ef8
7
- data.tar.gz: 350557fe24622988b175018ce216fb309e8b8db4bdf88aa868c205e148704b69f4c6334f14a23df218dcdb076ad5302322aff2ea5d71c032714f29c19ec668e3
6
+ metadata.gz: 2041851e908051b684b3a0a9cefd7a6b9828cf531104fa58c13e4b549550151bd2a111406f12fff38ddf1afb5391cb2540c67e3ce12504f6e8e98d74eef21327
7
+ data.tar.gz: f465a9b87b687c9e4306e43b4fb5883a89b5c31d31cdd4f0e2e0896d86f165ab8e94733054a72f1ca9212be29c917f81e19b0393cb97217b8f25711f727a9f58
data/CHANGELOG.md ADDED
@@ -0,0 +1,8 @@
1
+ # v0.0.2
2
+
3
+ - Fix bug where `:ssl_version` is a string when it should be a symbol
4
+ - Fix bug where attributes with nil values are passed into `Savon.client` (like a nil logger)
5
+
6
+ # v0.0.1
7
+
8
+ Initial version
@@ -7,7 +7,7 @@ module SoapAdapters
7
7
  attribute :wsdl, String
8
8
  attribute :logger
9
9
  attribute :log, Boolean, default: true
10
- attribute :ssl_version, String, default: :TLSv1
10
+ attribute :ssl_version, Symbol, default: :TLSv1
11
11
  attribute :last_request, String
12
12
 
13
13
  def ssl_version
@@ -24,7 +24,8 @@ module SoapAdapters
24
24
 
25
25
  def client
26
26
  args = CLIENT_ATTRS.reduce({}) do |hash, attr|
27
- hash[attr] = self.attributes.fetch(attr)
27
+ val = self.attributes.fetch(attr)
28
+ hash[attr] = val unless val.nil?
28
29
  hash
29
30
  end
30
31
  ::Savon.client(args)
@@ -1,3 +1,3 @@
1
1
  module SoapAdapters
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
@@ -6,8 +6,8 @@ require 'soap_adapters/version'
6
6
  Gem::Specification.new do |spec|
7
7
  spec.name = "soap_adapters"
8
8
  spec.version = SoapAdapters::VERSION
9
- spec.authors = ["Ramon Tayag"]
10
- spec.email = ["G5", "ramon.tayag@gmail.com", "lateam@getg5.com"]
9
+ spec.authors = ["G5", "Ramon Tayag"]
10
+ spec.email = ["ramon.tayag@gmail.com", "lateam@getg5.com"]
11
11
  spec.summary = %q{Common interface to soap clients}
12
12
  spec.description = %q{Common interface to soap clients}
13
13
  spec.homepage = ""
@@ -10,7 +10,7 @@ describe SoapAdapters::Savon do
10
10
  it { is_expected.to have_attribute(:logger) }
11
11
  it { is_expected.to have_attribute(:log).with_default(true) }
12
12
  it do
13
- is_expected.to have_attribute(:ssl_version, String).with_default(:TLSv1)
13
+ is_expected.to have_attribute(:ssl_version, Symbol).with_default(:TLSv1)
14
14
  end
15
15
  it { is_expected.to have_attribute(:last_request, String) }
16
16
  end
@@ -48,6 +48,19 @@ describe SoapAdapters::Savon do
48
48
  expect(r.to_s).to eq "response_xml"
49
49
  expect(r.xml).to eq "response_xml"
50
50
  end
51
+
52
+ it "instantiates a Savon client passing only arguments that are present" do
53
+ allow(::Savon).to receive(:client).with(
54
+ wsdl: "wsdl",
55
+ log: false,
56
+ ssl_version: :TLSv1,
57
+ ).and_return(client)
58
+ adapter = described_class.new(wsdl: "wsdl", log: false)
59
+ r = adapter.call(*client_args)
60
+ expect(adapter.last_request).to eq "request_xml"
61
+ expect(r.to_s).to eq "response_xml"
62
+ expect(r.xml).to eq "response_xml"
63
+ end
51
64
  end
52
65
 
53
66
  end
metadata CHANGED
@@ -1,9 +1,10 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: soap_adapters
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
+ - G5
7
8
  - Ramon Tayag
8
9
  autorequire:
9
10
  bindir: bin
@@ -96,7 +97,6 @@ dependencies:
96
97
  version: '0'
97
98
  description: Common interface to soap clients
98
99
  email:
99
- - G5
100
100
  - ramon.tayag@gmail.com
101
101
  - lateam@getg5.com
102
102
  executables: []
@@ -104,6 +104,7 @@ extensions: []
104
104
  extra_rdoc_files: []
105
105
  files:
106
106
  - ".gitignore"
107
+ - CHANGELOG.md
107
108
  - Gemfile
108
109
  - LICENSE.md
109
110
  - LICENSE.txt