You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@buildr.apache.org by do...@apache.org on 2014/05/25 09:31:42 UTC
[6/8] git commit: Update matcher to ensure it fails on non-match
Update matcher to ensure it fails on non-match
Project: http://git-wip-us.apache.org/repos/asf/buildr/repo
Commit: http://git-wip-us.apache.org/repos/asf/buildr/commit/6c391f0e
Tree: http://git-wip-us.apache.org/repos/asf/buildr/tree/6c391f0e
Diff: http://git-wip-us.apache.org/repos/asf/buildr/diff/6c391f0e
Branch: refs/heads/master
Commit: 6c391f0e75ef76b8357d27bec404195e66f2c6d5
Parents: 03bd79f
Author: Peter Donald <pe...@realityforge.org>
Authored: Sun May 25 17:19:57 2014 +1000
Committer: Peter Donald <pe...@realityforge.org>
Committed: Sun May 25 17:19:57 2014 +1000
----------------------------------------------------------------------
spec/xpath_matchers.rb | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/buildr/blob/6c391f0e/spec/xpath_matchers.rb
----------------------------------------------------------------------
diff --git a/spec/xpath_matchers.rb b/spec/xpath_matchers.rb
index e15bd3c..3bb3426 100644
--- a/spec/xpath_matchers.rb
+++ b/spec/xpath_matchers.rb
@@ -61,7 +61,7 @@ module RSpec
def matches?(response)
@response = response
doc = response.is_a?(REXML::Document) ? response : REXML::Document.new(@response)
- ok = true
+ ok = false
REXML::XPath.each(doc, @xpath) do |e|
@actual_val = case e
when REXML::Attribute
@@ -71,6 +71,7 @@ module RSpec
else
e.to_s
end
+ ok = true
return false unless @val == @actual_val
end
return ok