Skip to content

Commit abff900

Browse files
committed
💚 Create Document instead of Element
1 parent adc654e commit abff900

File tree

3 files changed

+29
-14
lines changed

3 files changed

+29
-14
lines changed

‎.idea/workspace.xml

Lines changed: 21 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎lib/openid/yadis/filters.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,6 @@ def get_service_endpoints(yadis_url, service_element)
8787
endpoint = BasicServiceEndpoint.new(
8888
yadis_url, type_uris, uri, service_element
8989
)
90-
9190
e = apply_filters(endpoint)
9291
endpoints << e unless e.nil?
9392
end

‎test/test_filters.rb

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,23 +44,24 @@ def test_from_basic_service_endpoint
4444
end
4545

4646
class TransformFilterMakerTest < Minitest::Test
47-
def make_service_element(types, uris)
48-
service = REXML::Element.new("Service")
47+
def make_service_document(types, uris)
48+
document = REXML::Document.new
49+
element = document.add_element("Service")
4950
types.each do |type_text|
50-
service.add_element("Type").text = type_text
51+
element.add_element("Type").text = type_text
5152
end
5253
uris.each do |uri_text|
53-
service.add_element("URI").text = uri_text
54+
element.add_element("URI").text = uri_text
5455
end
55-
service
56+
document
5657
end
5758

5859
def test_get_service_endpoints
5960
yadis_url = "http://yad.is/"
6061
uri = "http://uri/"
6162
type_uris = ["urn:type1", "urn:type2"]
62-
element = make_service_element(type_uris, [uri])
63-
63+
document = make_service_document(type_uris, [uri])
64+
element = document.root
6465
filters = [proc do |endpoint|
6566
endpoint if endpoint.service_element == element
6667
end]

0 commit comments

Comments
 (0)