diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2011-10-04 10:55:36 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2011-10-04 10:55:36 -0700 |
commit | 524da347f58842a788e205877e0ff7079cb9bad3 (patch) | |
tree | 8a6f8a3858f8c2272db70c199542794db16b0169 /test/psych/test_exception.rb | |
parent | 64f27edacf6adda4b58406ef9f073c147465e077 (diff) | |
download | psych-524da347f58842a788e205877e0ff7079cb9bad3.tar.gz |
adding more information to the syntax error exception
Diffstat (limited to 'test/psych/test_exception.rb')
-rw-r--r-- | test/psych/test_exception.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/test/psych/test_exception.rb b/test/psych/test_exception.rb index 806c5e2..5530a69 100644 --- a/test/psych/test_exception.rb +++ b/test/psych/test_exception.rb @@ -16,6 +16,21 @@ module Psych @wups = Wups.new end + def test_attributes + e = assert_raises(Psych::SyntaxError) { + Psych.load '--- `foo' + } + + assert_equal '<unknown>', e.file + assert_equal 1, e.line + assert_equal 5, e.column + # FIXME: offset isn't being set correctly by libyaml + # assert_equal 5, e.offset + + assert e.problem + assert e.context + end + def test_convert w = Psych.load(Psych.dump(@wups)) assert_equal @wups, w |