lib/soaspec/exchange_handlers/exchange_handler.rb in soaspec-0.0.35 vs lib/soaspec/exchange_handlers/exchange_handler.rb in soaspec-0.0.36
- old
+ new
@@ -33,24 +33,30 @@
# @return [Array] Array of symbols specifying element names
def expected_mandatory_elements
[]
end
- # Use this to set 'expected_mandatory_elements' see 'accessors'
- def mandatory_elements
- []
+ # Change this through 'mandatory_xpath_values' method to specify xpath results that must be present in the response
+ # Will be used in 'success_scenarios' shared examples
+ # @return [Hash] Hash of 'xpath' => 'expected value' pairs
+ def expected_mandatory_xpath_values
+ {}
end
- # Override this to specify xpath results that must be present in the response
+ # Change this through 'mandatory_json_values' method to specify json results that must be present in the response
# Will be used in 'success_scenarios' shared examples
# @return [Hash] Hash of 'xpath' => 'expected value' pairs
- def expected_mandatory_xpath_values
+ def expected_mandatory_json_values
{}
end
- # Use this to set 'expected_mandatory_xpath_values' see 'accessors'
- def mandatory_xpath_values
- []
+ # Stores a value in a method that can be accessed by the provided name
+ # @param [Symbol] name Name of method to use to access this value within handler
+ # @param [String] value Value to store
+ def store(name, value)
+ define_singleton_method(name.to_s) do
+ value
+ end
end
end
end
\ No newline at end of file