summaryrefslogtreecommitdiff
path: root/test/psych/test_parser.rb
diff options
context:
space:
mode:
authortenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-05-19 03:24:13 +0000
committertenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-05-19 03:24:13 +0000
commitc1b29ff5c6db8dd9a4d3508896eb3856eb9974da (patch)
tree2389042e7eed64487d74643f81710c9290912ccf /test/psych/test_parser.rb
parent15335f8aaa8282fd951935135aa04b3d938a267c (diff)
* ext/psych/lib/psych.rb: Adding Psych::Exception
* ext/psych/parser.c: Do not allow extern_encoding to be set twice * test/psych/test_parser.rb: test git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27882 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/psych/test_parser.rb')
-rw-r--r--test/psych/test_parser.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/psych/test_parser.rb b/test/psych/test_parser.rb
index 8c44833..0b1e92e 100644
--- a/test/psych/test_parser.rb
+++ b/test/psych/test_parser.rb
@@ -26,6 +26,15 @@ module Psych
@parser = Psych::Parser.new EventCatcher.new
end
+ def test_set_encoding_twice
+ @parser.external_encoding = Psych::Parser::UTF16LE
+
+ e = assert_raises(Psych::Exception) do
+ @parser.external_encoding = Psych::Parser::UTF16LE
+ end
+ assert_equal "don't set the encoding twice!", e.message
+ end
+
def test_bom
tadpole = 'おたまじゃくし'