lib/soaspec/matchers.rb in soaspec-0.0.6 vs lib/soaspec/matchers.rb in soaspec-0.0.7

- old
+ new

@@ -9,9 +9,19 @@ failure_message do |actual| "expected that #{actual.response.body} would contain value #{expected}" end end +RSpec::Matchers.define :contain_key do |expected| + match do |actual| + expect(actual.response.body.include_key?(expected)).to be true + end + + failure_message do |actual| + "expected that #{actual.response.body} would contain key #{expected}" + end +end + RSpec::Matchers.define :have_element_at_xpath do |expected| match do |exchange| expect(exchange.xml_doc.at_xpath(expected, Soaspec::Environment.api_handler.namespaces).content).not_to be_empty end end \ No newline at end of file