lib/soaspec/exchange.rb in soaspec-0.0.4 vs lib/soaspec/exchange.rb in soaspec-0.0.5
- old
+ new
@@ -1,11 +1,14 @@
require_relative '../soaspec'
+#require_relative 'basic_soap_handler'
# This represents a request / response pair
class Exchange
attr_reader :xml_response
+ attr_reader :xml_doc
+
def initialize(name, override_parameters = {})
@test_name = name.to_s
@api_class = Soaspec::Environment.api_handler
@override_parameters = override_parameters
end
@@ -17,10 +20,13 @@
# Name describing this class when used with `RSpec.describe`
# @return [String] Name given when initializing
def to_s
@response = self.make_request
- @xml_response = @response.to_xml
+ if Soaspec::Environment.api_handler.class == Soaspec::BasicSoapHandler
+ @xml_response = @response.to_xml
+ @xml_doc = Nokogiri::XML(@xml_response)
+ end
@test_name
end
def contain(value)
@xml_response.include? value
\ No newline at end of file