lib/soaspec/matchers.rb in soaspec-0.0.10 vs lib/soaspec/matchers.rb in soaspec-0.0.11
- old
+ new
@@ -30,6 +30,11 @@
RSpec::Matchers.define :have_xpath_value do |expected_hash|
match do |exchange|
expected_hash = Hash[*expected_hash.flatten] if expected_hash.is_a?(Array) # For some reason Array was occuring
expect(exchange[expected_hash.keys.first]).to eq expected_hash.values.first
end
+
+ failure_message do |actual|
+ "expected that xpath '#{expected_hash.keys.first}' has value '#{expected_hash.values.first}' but was '#{actual[expected_hash.keys.first]}'"
+ end
+
end
\ No newline at end of file