From 8bc51a393acfb5af4e446799e51f73e61b0cfc8e Mon Sep 17 00:00:00 2001
From: Samuel Giddins <segiddins@segiddins.me>
Date: Tue, 20 Feb 2024 11:03:28 -0800
Subject: [PATCH] [rubygems/rubygems] Check for correct exception on older
 psych versions

https://github.com/rubygems/rubygems/commit/52de6eccf5

Reference:https://github.com/ruby/ruby/commit/8bc51a393acfb5af4e446799e51f73e61b0cfc8e
Conflict:use assert_raises not assert_raise
---
 test/rubygems/test_gem_safe_yaml.rb | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/test/rubygems/test_gem_safe_yaml.rb b/test/rubygems/test_gem_safe_yaml.rb
index 4f7e400132..02df9f97da 100644
--- a/test/rubygems/test_gem_safe_yaml.rb
+++ b/test/rubygems/test_gem_safe_yaml.rb
@@ -14,7 +14,8 @@ def test_aliases_disabled
     aliases_enabled = Gem::SafeYAML.aliases_enabled?
     Gem::SafeYAML.aliases_enabled = false
     refute_predicate Gem::SafeYAML, :aliases_enabled?
-    assert_raises Psych::AliasesNotEnabled do
+    expected_error = defined?(Psych::AliasesNotEnabled) ? Psych::AliasesNotEnabled : Psych::BadAlias
+    assert_raises expected_error do
       Gem::SafeYAML.safe_load("a: &a\nb: *a\n")
     end
   ensure
-- 
2.33.0


