From 72a63ef7fd288f2dab7cf839c5da726cfb05875e Mon Sep 17 00:00:00 2001 From: Joe Rafaniello Date: Thu, 12 Oct 2023 15:15:52 -0400 Subject: [PATCH] For tests, use YAML.unsafe load in psych 4+ Part of https://github.com/ManageIQ/manageiq/issues/22696 --- spec/support/yaml_alias_load_as_unsafe_load.rb | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 spec/support/yaml_alias_load_as_unsafe_load.rb diff --git a/spec/support/yaml_alias_load_as_unsafe_load.rb b/spec/support/yaml_alias_load_as_unsafe_load.rb new file mode 100644 index 000000000..fbd7514d9 --- /dev/null +++ b/spec/support/yaml_alias_load_as_unsafe_load.rb @@ -0,0 +1,4 @@ +if Psych::VERSION >= "4.0" + require 'yaml' + YAML.singleton_class.alias_method :load, :unsafe_load +end