1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* remove trailing spaces.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31573 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2011-05-15 11:55:52 +00:00
parent 39da1b6369
commit 3a47cf3395
212 changed files with 846 additions and 846 deletions

View file

@ -6,7 +6,7 @@ require 'test/unit'
require 'rexml/document'
class TestRexmlXpathAttributeQuery < Test::Unit::TestCase
# xmlstr1 and xmlstr2 only differ in the second line - namespaces in the root element
@@xmlstr1 = '<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/" xmlns:gd="http://schemas.google.com/g/2005" xmlns:gCal="http://schemas.google.com/gCal/2005">
@ -26,7 +26,7 @@ class TestRexmlXpathAttributeQuery < Test::Unit::TestCase
</entry>
</feed>'
@@xmlstr2 = '<?xml version="1.0" encoding="UTF-8"?>
<feed>
<id>http://www.google.com/calendar/feeds/me%40gmail.com</id>
@ -44,22 +44,22 @@ class TestRexmlXpathAttributeQuery < Test::Unit::TestCase
</author>
</entry>
</feed>'
# Fails
def test_xpath_query
do_test @@xmlstr1
end
# Passes
def test_xpath_query_no_namespace
do_test @@xmlstr2
end
def do_test(xmlString)
hrefs = [
"http://www.google.com/calendar/feeds/me%40gmail.com/private/full",
"http://www.google.com/calendar/feeds/me%40gmail.com/acl/full",
"http://www.google.com/calendar/feeds/me%40gmail.com/me%40gmail.com"
hrefs = [
"http://www.google.com/calendar/feeds/me%40gmail.com/private/full",
"http://www.google.com/calendar/feeds/me%40gmail.com/acl/full",
"http://www.google.com/calendar/feeds/me%40gmail.com/me%40gmail.com"
]
ctr=0
REXML::Document.new(xmlString).elements.each("feed/entry") do |element|
@ -70,13 +70,13 @@ class TestRexmlXpathAttributeQuery < Test::Unit::TestCase
end
end
def test_another_way
doc = REXML::Document.new(@@xmlstr1)
hrefs = [
"http://www.google.com/calendar/feeds/me%40gmail.com/private/full",
"http://www.google.com/calendar/feeds/me%40gmail.com/acl/full",
"http://www.google.com/calendar/feeds/me%40gmail.com/me%40gmail.com"
hrefs = [
"http://www.google.com/calendar/feeds/me%40gmail.com/private/full",
"http://www.google.com/calendar/feeds/me%40gmail.com/acl/full",
"http://www.google.com/calendar/feeds/me%40gmail.com/me%40gmail.com"
]
ctr=0
REXML::XPath.each(doc, "//link[@rel='alternate']") do |element|