aboutsummaryrefslogtreecommitdiffstats
path: root/test/webrick
diff options
context:
space:
mode:
authorayumin <ayumin@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-05-19 14:58:00 +0000
committerayumin <ayumin@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-05-19 14:58:00 +0000
commita920927afd8e136e72344ada1b68939b5e9acf88 (patch)
treef37dd4142627db0306e6f88d7b4622680129a07e /test/webrick
parentc54733e1206c2d7434610c8f7f2875f082231cfd (diff)
downloadruby-a920927afd8e136e72344ada1b68939b5e9acf88.tar.gz
* test/webrick/test_htmlutils.rb: add test for WEBrick::HTMLUtils.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40830 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/webrick')
-rw-r--r--test/webrick/test_htmlutils.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/webrick/test_htmlutils.rb b/test/webrick/test_htmlutils.rb
new file mode 100644
index 0000000000..987bc229c9
--- /dev/null
+++ b/test/webrick/test_htmlutils.rb
@@ -0,0 +1,16 @@
+require "test/unit"
+require "webrick/htmlutils"
+
+class TestWEBrickHTMLUtils < Test::Unit::TestCase
+ include WEBrick::HTMLUtils
+
+ def test_escape
+ assert_equal("foo", escape("foo"))
+ assert_equal("foo bar", escape("foo bar"))
+ assert_equal("foo&amp;bar", escape("foo&bar"))
+ assert_equal("foo&quot;bar", escape("foo\"bar"))
+ assert_equal("foo&gt;bar", escape("foo>bar"))
+ assert_equal("foo&lt;bar", escape("foo<bar"))
+ assert_equal("こんにちは", escape("こんにちは"))
+ end
+end