soaspec 0.0.4 → 0.0.5

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: c1805cb5be5ab743cd17f02e7d53ddf24f0ba175
4
- data.tar.gz: 36bc197f389c6793e2c19f04e6cd963a862037b1
3
+ metadata.gz: f395a0cc30e441c00a3e346a4459f4ebaa18fd6e
4
+ data.tar.gz: c65e6c7f16beecc9bbf6e03bc72d57b1bc2ac854
5
5
  SHA512:
6
- metadata.gz: f54a833a24e00f025bc735a8ca53fa84873889be22a1cb506c4a419fd4593a17e046b02df5a03ef13e4b59e4c5f9accf8fb0bfaf8aa2edc6dac47bad881df5d5
7
- data.tar.gz: 3014aba6ec80e3ff30ed71953c47b04149a91e9df7136fdee3e97f93f47cd746e6192f3b2ffbca59a74d73ca26c51c799dbd858c5722395e65e8e4016d4144c0
6
+ metadata.gz: 9bc961c9a486a22ef009384c623c9aa0e10013aafdb5e7873841834610bd5117a82a38adfc103648a557059c3b654e9f4a6905e82f02163663b6c844a34ec261
7
+ data.tar.gz: df9820311485b6c5f5ba942bba0337f83ea5ccb3f54f74dc485c7d4f097071498c946a0f3e62707c2d4ee87cd33a8280b97d5fbcf9575d1d82ad3185ed2995b9
data/Gemfile CHANGED
@@ -1,6 +1,6 @@
1
1
  source "https://rubygems.org"
2
2
 
3
- git_source(:github) { |repo_name| "https://gitlab.com/samuel-garratt/soaspec" }
3
+ git_source(:gitlab) { |repo_name| "https://gitlab.com/samuel-garratt/soaspec" }
4
4
 
5
5
  # Specify your gem's dependencies in soaspec.gemspec
6
6
  gemspec
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- soaspec (0.0.4)
4
+ soaspec (0.0.5)
5
5
  rest-client (>= 2.0)
6
6
  rspec (~> 3.0)
7
7
  savon (>= 2)
@@ -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
- @xml_response = @response.to_xml
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
 
@@ -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
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Soaspec
2
- VERSION = '0.0.4'
2
+ VERSION = '0.0.5'
3
3
  end
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
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-17 00:00:00.000000000 Z
11
+ date: 2018-01-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler