soaspec 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +1 -1
- data/Gemfile.lock +1 -1
- data/lib/soaspec/exchange.rb +7 -1
- data/lib/soaspec/matchers.rb +12 -0
- data/lib/soaspec/tester.rb +0 -8
- data/lib/soaspec/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f395a0cc30e441c00a3e346a4459f4ebaa18fd6e
|
4
|
+
data.tar.gz: c65e6c7f16beecc9bbf6e03bc72d57b1bc2ac854
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9bc961c9a486a22ef009384c623c9aa0e10013aafdb5e7873841834610bd5117a82a38adfc103648a557059c3b654e9f4a6905e82f02163663b6c844a34ec261
|
7
|
+
data.tar.gz: df9820311485b6c5f5ba942bba0337f83ea5ccb3f54f74dc485c7d4f097071498c946a0f3e62707c2d4ee87cd33a8280b97d5fbcf9575d1d82ad3185ed2995b9
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
data/lib/soaspec/exchange.rb
CHANGED
@@ -1,9 +1,12 @@
|
|
1
1
|
require_relative '../soaspec'
|
2
|
+
#require_relative 'basic_soap_handler'
|
2
3
|
# This represents a request / response pair
|
3
4
|
class Exchange
|
4
5
|
|
5
6
|
attr_reader :xml_response
|
6
7
|
|
8
|
+
attr_reader :xml_doc
|
9
|
+
|
7
10
|
def initialize(name, override_parameters = {})
|
8
11
|
@test_name = name.to_s
|
9
12
|
@api_class = Soaspec::Environment.api_handler
|
@@ -19,7 +22,10 @@ class Exchange
|
|
19
22
|
# @return [String] Name given when initializing
|
20
23
|
def to_s
|
21
24
|
@response = self.make_request
|
22
|
-
|
25
|
+
if Soaspec::Environment.api_handler.class == Soaspec::BasicSoapHandler
|
26
|
+
@xml_response = @response.to_xml
|
27
|
+
@xml_doc = Nokogiri::XML(@xml_response)
|
28
|
+
end
|
23
29
|
@test_name
|
24
30
|
end
|
25
31
|
|
data/lib/soaspec/matchers.rb
CHANGED
@@ -2,4 +2,16 @@ RSpec::Matchers.define :contain do |expected|
|
|
2
2
|
match do |actual|
|
3
3
|
expect(actual.xml_response).to include expected
|
4
4
|
end
|
5
|
+
end
|
6
|
+
|
7
|
+
RSpec::Matchers.define :have_element_at_xpath do |expected|
|
8
|
+
match do |soap_class|
|
9
|
+
expect(soap_class.xml_doc.at_xpath(expected, Soaspec::Environment.api_handler.namespaces).content).not_to be_empty
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
RSpec::Matchers.define :have_xpath_value do |expected_hash|
|
14
|
+
match do |soap_class|
|
15
|
+
expect(soap_class.xml_doc.at_xpath(expected_hash.keys.first, Soaspec::Environment.api_handler.namespaces).content).to eq expected_hash.values.first
|
16
|
+
end
|
5
17
|
end
|
data/lib/soaspec/tester.rb
CHANGED
@@ -13,14 +13,6 @@ module Soaspec
|
|
13
13
|
@name = name
|
14
14
|
end
|
15
15
|
|
16
|
-
# Name describing this class when used with `RSpec.describe`
|
17
|
-
# @return [String] Name given when initializing
|
18
|
-
def to_s
|
19
|
-
@response = make_request
|
20
|
-
@xml_response = @response.to_xml
|
21
|
-
@test_name
|
22
|
-
end
|
23
|
-
|
24
16
|
def template_name=(name)
|
25
17
|
@request_option = :template
|
26
18
|
@template_name = name
|
data/lib/soaspec/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: soaspec
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- SamuelGarrattIQA
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-01-
|
11
|
+
date: 2018-01-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|