summaryrefslogtreecommitdiff
path: root/test/psych/test_parser.rb
diff options
context:
space:
mode:
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 8c4483309b..0b1e92e62e 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 = 'おたまじゃくし'