summaryrefslogtreecommitdiff
path: root/test/rexml
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-02-24 13:10:46 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-02-24 13:10:46 +0000
commitef339580947c7df1281263ccfb99718887e5378d (patch)
tree49b17e75bae90e436884ade206c10209db785884 /test/rexml
parent66f913572682f54eda3b0d4b78c5e9cef08043dd (diff)
Use require_relative to require local library
* from 1.9 require relative path from the file must use require_relative. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39476 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/rexml')
-rw-r--r--test/rexml/rexml_test_utils.rb1
-rw-r--r--test/rexml/test_contrib.rb2
-rw-r--r--test/rexml/test_core.rb4
-rw-r--r--test/rexml/test_encoding.rb2
-rw-r--r--test/rexml/test_jaxen.rb2
-rw-r--r--test/rexml/test_light.rb2
-rw-r--r--test/rexml/test_lightparser.rb2
-rw-r--r--test/rexml/test_listener.rb10
-rw-r--r--test/rexml/test_namespace.rb2
-rw-r--r--test/rexml/test_order.rb2
-rw-r--r--test/rexml/test_rexml_issuezilla.rb2
-rw-r--r--test/rexml/test_sax.rb2
-rw-r--r--test/rexml/test_xpath.rb2
13 files changed, 18 insertions, 17 deletions
diff --git a/test/rexml/rexml_test_utils.rb b/test/rexml/rexml_test_utils.rb
index 916e736..57fe65c 100644
--- a/test/rexml/rexml_test_utils.rb
+++ b/test/rexml/rexml_test_utils.rb
@@ -1,3 +1,4 @@
+require 'test/unit'
module REXMLTestUtils
def fixture_path(*components)
File.join(File.dirname(__FILE__), "data", *components)
diff --git a/test/rexml/test_contrib.rb b/test/rexml/test_contrib.rb
index db7c18d..356dfc1 100644
--- a/test/rexml/test_contrib.rb
+++ b/test/rexml/test_contrib.rb
@@ -1,6 +1,6 @@
# coding: binary
-require "rexml_test_utils"
+require_relative "rexml_test_utils"
require "rexml/document"
require "rexml/parseexception"
diff --git a/test/rexml/test_core.rb b/test/rexml/test_core.rb
index 0865aa97..7040ad6 100644
--- a/test/rexml/test_core.rb
+++ b/test/rexml/test_core.rb
@@ -1,6 +1,6 @@
# coding: binary
-require "rexml_test_utils"
+require_relative "rexml_test_utils"
require "rexml/document"
require "rexml/parseexception"
@@ -9,7 +9,7 @@ require "rexml/source"
require "rexml/formatters/pretty"
require "rexml/undefinednamespaceexception"
-require "listener"
+require_relative "listener"
class Tester < Test::Unit::TestCase
include REXMLTestUtils
diff --git a/test/rexml/test_encoding.rb b/test/rexml/test_encoding.rb
index 9bcdfb3..a3fda1e 100644
--- a/test/rexml/test_encoding.rb
+++ b/test/rexml/test_encoding.rb
@@ -1,6 +1,6 @@
# coding: binary
-require "rexml_test_utils"
+require_relative "rexml_test_utils"
require 'rexml/source'
require 'rexml/document'
diff --git a/test/rexml/test_jaxen.rb b/test/rexml/test_jaxen.rb
index 222cf79..05cb818 100644
--- a/test/rexml/test_jaxen.rb
+++ b/test/rexml/test_jaxen.rb
@@ -1,4 +1,4 @@
-require 'rexml_test_utils'
+require_relative 'rexml_test_utils'
require "rexml/document"
require "rexml/xpath"
diff --git a/test/rexml/test_light.rb b/test/rexml/test_light.rb
index 1b56159..9ce0fb5 100644
--- a/test/rexml/test_light.rb
+++ b/test/rexml/test_light.rb
@@ -1,4 +1,4 @@
-require "rexml_test_utils"
+require_relative "rexml_test_utils"
require "rexml/light/node"
require "rexml/parsers/lightparser"
diff --git a/test/rexml/test_lightparser.rb b/test/rexml/test_lightparser.rb
index 1728921..c32c1b8 100644
--- a/test/rexml/test_lightparser.rb
+++ b/test/rexml/test_lightparser.rb
@@ -1,4 +1,4 @@
-require 'rexml_test_utils'
+require_relative 'rexml_test_utils'
require 'rexml/parsers/lightparser'
class LightParserTester < Test::Unit::TestCase
diff --git a/test/rexml/test_listener.rb b/test/rexml/test_listener.rb
index 0afbdcd..a3d763c 100644
--- a/test/rexml/test_listener.rb
+++ b/test/rexml/test_listener.rb
@@ -1,6 +1,6 @@
# coding: binary
-require 'rexml_test_utils'
+require_relative 'rexml_test_utils'
require 'rexml/document'
require 'rexml/streamlistener'
@@ -82,16 +82,16 @@ class BaseTester < Test::Unit::TestCase
end
def test_accents
- source = '<?xml version="1.0" encoding="ISO-8859-1"?>
+ source = %[<?xml version="1.0" encoding="ISO-8859-1"?>
<g>
-<f a="" />
-</g>'
+<f a="\xE9" />
+</g>]
doc = REXML::Document.new( source )
a = doc.elements['/g/f'].attribute('a')
if a.value.respond_to? :force_encoding
a.value.force_encoding('binary')
end
- assert_equal( 'é', a.value)
+ assert_equal( "\xC3\xA9", a.value)
doc = REXML::Document.parse_stream(
File::new(fixture_path("stream_accents.xml")),
AccentListener::new
diff --git a/test/rexml/test_namespace.rb b/test/rexml/test_namespace.rb
index 6ab16b6..f855203 100644
--- a/test/rexml/test_namespace.rb
+++ b/test/rexml/test_namespace.rb
@@ -1,4 +1,4 @@
-require "rexml_test_utils"
+require_relative "rexml_test_utils"
require "rexml/document"
diff --git a/test/rexml/test_order.rb b/test/rexml/test_order.rb
index 3f874c2..3fcbf97 100644
--- a/test/rexml/test_order.rb
+++ b/test/rexml/test_order.rb
@@ -1,4 +1,4 @@
-require 'rexml_test_utils'
+require_relative 'rexml_test_utils'
require 'rexml/document'
begin
require 'zlib'
diff --git a/test/rexml/test_rexml_issuezilla.rb b/test/rexml/test_rexml_issuezilla.rb
index a0ebfa7..2a12006 100644
--- a/test/rexml/test_rexml_issuezilla.rb
+++ b/test/rexml/test_rexml_issuezilla.rb
@@ -1,4 +1,4 @@
-require 'rexml_test_utils'
+require_relative 'rexml_test_utils'
require 'rexml/document'
class TestIssuezillaParsing < Test::Unit::TestCase
diff --git a/test/rexml/test_sax.rb b/test/rexml/test_sax.rb
index 8873e17..4a9db40 100644
--- a/test/rexml/test_sax.rb
+++ b/test/rexml/test_sax.rb
@@ -1,4 +1,4 @@
-require "rexml_test_utils"
+require_relative "rexml_test_utils"
require 'rexml/sax2listener'
require 'rexml/parsers/sax2parser'
require 'rexml/document'
diff --git a/test/rexml/test_xpath.rb b/test/rexml/test_xpath.rb
index 4ccd4ed..927909a 100644
--- a/test/rexml/test_xpath.rb
+++ b/test/rexml/test_xpath.rb
@@ -1,4 +1,4 @@
-require "rexml_test_utils"
+require_relative "rexml_test_utils"
require "rexml/document"