Skip to content

Commit

Permalink
NodeSelection delegates /
Browse files Browse the repository at this point in the history
  • Loading branch information
troelskn committed Jul 30, 2009
1 parent 04d3334 commit b4ad2bf
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/handsoap/xml_query_front.rb
Expand Up @@ -90,6 +90,9 @@ def node_name
def xpath(expression, ns = nil)
self.first.xpath(expression, ns)
end
def /(expression)
self.first.xpath(expression)
end
def to_xml
self.first.to_xml if self.any?
end
Expand Down
5 changes: 5 additions & 0 deletions tests/xml_query_front_test.rb
Expand Up @@ -106,6 +106,11 @@ def test_query_result_is_mappable
def test_resultset_inherits_prefixes
doc = create_default_document
assert_equal "3f8ceabd-2d15-47f0-b35e-d52ee868a4a6", doc.xpath("//foo:OperationRequest").first.xpath("aws:RequestId").first.to_s
end
def test_resultset_delegates_slash
doc = create_default_document
operation_request = (doc/"//foo:OperationRequest")
assert_equal "3f8ceabd-2d15-47f0-b35e-d52ee868a4a6", (operation_request/"aws:RequestId").to_s
end
def test_attribute_can_cast_to_boolean
doc = create_default_document
Expand Down

0 comments on commit b4ad2bf

Please sign in to comment.