summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2012-02-09 10:46:50 -0800
committerAaron Patterson <aaron.patterson@gmail.com>2012-02-09 10:46:50 -0800
commit86e02603780a10107e64b2572347e85b257005c2 (patch)
tree81f769e0a04045c6ac9b6a587ee34ca73f8f6e88 /test
parente2fcf9af9e95535401f816bc893839b9ad743a9e (diff)
downloadpsych-86e02603780a10107e64b2572347e85b257005c2.zip
* ext/psych/parser.c: removed external encoding setter, allow parser
to be reused. * ext/psych/lib/psych/parser.rb: added external encoding setter. * test/psych/test_parser.rb: test parser reuse
Diffstat (limited to 'test')
-rw-r--r--test/psych/test_parser.rb15
1 files changed, 6 insertions, 9 deletions
diff --git a/test/psych/test_parser.rb b/test/psych/test_parser.rb
index b607514..a491d7f 100644
--- a/test/psych/test_parser.rb
+++ b/test/psych/test_parser.rb
@@ -32,6 +32,12 @@ module Psych
@handler.parser = @parser
end
+ def test_multiparse
+ 3.times do
+ @parser.parse '--- foo'
+ end
+ end
+
def test_filename
ex = assert_raises(Psych::SyntaxError) do
@parser.parse '--- `', 'omg!'
@@ -87,15 +93,6 @@ module Psych
assert_equal 19, @parser.mark.index
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 = 'おたまじゃくし'