diff options
| author | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2025-01-08 16:12:25 +0900 |
|---|---|---|
| committer | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2025-01-08 17:12:19 +0900 |
| commit | a4528f60e5219417d15da70771f871ed089896f0 (patch) | |
| tree | 8a8065c018c39ed542d8765a44a8b32663147745 | |
| parent | 599a0601f60b0a3812b9ad1b95a8870cf2921d82 (diff) | |
Omit Psych_Unit_Tests if ostruct is not available
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/12531
| -rw-r--r-- | test/psych/test_yaml.rb | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/test/psych/test_yaml.rb b/test/psych/test_yaml.rb index 812a15dfcc..897a7c8935 100644 --- a/test/psych/test_yaml.rb +++ b/test/psych/test_yaml.rb @@ -2,7 +2,6 @@ # frozen_string_literal: true require_relative 'helper' -require 'ostruct' # [ruby-core:01946] module Psych_Tests @@ -15,8 +14,14 @@ class Psych_Unit_Tests < Psych::TestCase end def test_y_method - assert_raise(NoMethodError) do - OpenStruct.new.y 1 + begin + require 'ostruct' + + assert_raise(NoMethodError) do + OpenStruct.new.y 1 + end + rescue LoadError + omit("OpenStruct is not available") end end |
