summaryrefslogtreecommitdiff
path: root/test/psych/test_exception.rb
Commit message (Collapse)AuthorAgeFilesLines
* remove deprecated interfaceAaron Patterson2021-05-131-18/+0
|
* Introduce `Psych.unsafe_load`Aaron Patterson2021-05-131-4/+4
| | | | | | | | | | | | | | In future versions of Psych, the `load` method will be mostly the same as the `safe_load` method. In other words, the `load` method won't allow arbitrary object deserialization (which can be used to escalate to an RCE). People that need to load *trusted* documents can use the `unsafe_load` method. This commit introduces the `unsafe_load` method so that people can incrementally upgrade. For example, if they try to upgrade to 4.0.0 and something breaks, they can downgrade, audit callsites, change to `safe_load` or `unsafe_load` as required, and then upgrade to 4.0.0 smoothly.
* Use assert_raise instead of assert_raisesHiroshi SHIBATA2021-05-101-15/+15
|
* Add `Psych.safe_load_file`. Tweak doc to provide `safe_` examples.Marc-Andre Lafortune2020-11-121-0/+12
|
* Remove private_iv_getCharles Oliver Nutter2020-07-161-1/+2
| | | | | | | | | | | | | | | | | | | | | The only remaining use of this function was to get the internal message object from an exception's hidden `mesg` instance variable to allow it to be dumped wiithout converting to a string. As discussed in #103, this exposes internal implementation details of CRuby, and ultimately does not provide any real utility to the user since they can't directly inspect this hidden variable. The test change here is to reflect CRuby behavior that denies equality if the internal message objects do not match, as is the case after the exception has been loaded and now has a simple String value. The impact to users is that exceptions with special hidden message objects will convert those objects to String during marshaling through YAML. I believe this only affects NameError and its descendants, since users can't set this field directly on their own exception types. Fixes #103.
* Round trip exception backtracesAaron Patterson2019-01-091-0/+14
| | | | This commit allows exception backtraces to round trip
* Avoid to warnings for deprecated interfaces.SHIBATA Hiroshi2018-10-201-0/+6
|
* unifying interface of PsychGreg Houle2018-07-131-4/+22
|
* make frozen_string_literal: truefrozenSHIBATA Hiroshi2017-06-191-1/+1
|
* Remove to_yaml_propatiesSHIBATA Hiroshi2017-03-271-13/+0
|
* Temporary disabled to frozen literal string.SHIBATA Hiroshi2016-02-231-0/+1
| | | | ref. https://github.com/ruby/ruby/commit/3e92b635fb5422207b7bbdc924e292e51e21f040
* * ext/psych/lib/psych/visitors/yaml_tree.rb: fix NameError dumping andAaron Patterson2014-08-291-0/+6
| | | | | | | loading. Fixes GH #85. Thanks @brentdax for the patch! * test/psych/test_exception.rb: test for fix fixes #85
* merging from RubyAaron Patterson2013-05-141-20/+19
|
* sync with ruby trunkAaron Patterson2013-04-051-1/+1
|
* sync with ruby trunkAaron Patterson2013-02-061-0/+1
|
* Psych::SyntaxError now inherits from RuntimeErrorEric Hodel2012-10-221-0/+21
| | | | | | | | | | | Previously Psych::SyntaxError inherited from SyntaxError. Since SyntaxError does not inherit from StandardError a plain rescue could not capture a YAML parse error. This made code that needed to handle psych errors slightly more complex. Psych::SyntaxError now inherits from Psych::Error (allowing room for future expansion of psych errors that can be caught under the same umbrella) and inherits from RuntimeError.
* * ext/psych/lib/psych.rb (module Psych): parse and load methods takeAaron Patterson2011-12-061-1/+77
| | | | | | | | an optional file name that is used when raising Psych::SyntaxError exceptions * ext/psych/lib/psych/syntax_error.rb (module Psych): allow nil file names and handle nil file names in the exception message * test/psych/test_exception.rb (module Psych): Tests for changes.
* adding more information to the syntax error exceptionAaron Patterson2011-10-041-0/+15
|
* pulling in changes from ruby coreAaron Patterson2011-03-291-1/+1
|
* * test/psych/*: switching tests to use relative require. [ruby-core:29104]Aaron Patterson2010-03-291-1/+1
|
* removed the to_yaml methodAaron Patterson2010-03-271-9/+2
|
* adding a test helper superclassAaron Patterson2010-03-261-3/+3
|
* moving tests under the psych directoryAaron Patterson2010-03-261-0/+46