summaryrefslogtreecommitdiff
path: root/test/psych/test_exception.rb
AgeCommit message (Collapse)Author
2021-05-13remove deprecated interfaceAaron Patterson
2021-05-13Introduce `Psych.unsafe_load`Aaron Patterson
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.
2021-05-10Use assert_raise instead of assert_raisesHiroshi SHIBATA
2020-11-12Add `Psych.safe_load_file`. Tweak doc to provide `safe_` examples.Marc-Andre Lafortune
2020-07-16Remove private_iv_getCharles Oliver Nutter
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.
2019-01-09Round trip exception backtracesAaron Patterson
This commit allows exception backtraces to round trip
2018-10-20Avoid to warnings for deprecated interfaces.SHIBATA Hiroshi
2018-07-13unifying interface of PsychGreg Houle
2017-06-19make frozen_string_literal: trueSHIBATA Hiroshi
2017-03-27Remove to_yaml_propatiesSHIBATA Hiroshi
2016-02-23Temporary disabled to frozen literal string.SHIBATA Hiroshi
ref. https://github.com/ruby/ruby/commit/3e92b635fb5422207b7bbdc924e292e51e21f040
2014-08-29* ext/psych/lib/psych/visitors/yaml_tree.rb: fix NameError dumping andAaron Patterson
loading. Fixes GH #85. Thanks @brentdax for the patch! * test/psych/test_exception.rb: test for fix fixes #85
2013-05-14merging from RubyAaron Patterson
2013-04-05sync with ruby trunkAaron Patterson
2013-02-06sync with ruby trunkAaron Patterson
2012-10-22Psych::SyntaxError now inherits from RuntimeErrorEric Hodel
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.
2011-12-06* ext/psych/lib/psych.rb (module Psych): parse and load methods takeAaron Patterson
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.
2011-10-04adding more information to the syntax error exceptionAaron Patterson
2011-03-29pulling in changes from ruby coreAaron Patterson
2010-03-29* test/psych/*: switching tests to use relative require. [ruby-core:29104]Aaron Patterson
2010-03-27removed the to_yaml methodAaron Patterson
2010-03-26adding a test helper superclassAaron Patterson
2010-03-26moving tests under the psych directoryAaron Patterson