diff options
author | Hiroshi SHIBATA <[email protected]> | 2025-01-08 16:27:49 +0900 |
---|---|---|
committer | Hiroshi SHIBATA <[email protected]> | 2025-01-08 17:12:19 +0900 |
commit | ad5fa24e84be97212ef2d8763086020a44546dc1 (patch) | |
tree | 9529121de68e2e1538db0e0a93d6aa736706ebf6 /spec/ruby/library/yaml | |
parent | a4528f60e5219417d15da70771f871ed089896f0 (diff) |
Skip examples related with OpenStruct in ruby/spec
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/12531
Diffstat (limited to 'spec/ruby/library/yaml')
-rw-r--r-- | spec/ruby/library/yaml/dump_spec.rb | 6 | ||||
-rw-r--r-- | spec/ruby/library/yaml/shared/load.rb | 6 |
2 files changed, 10 insertions, 2 deletions
diff --git a/spec/ruby/library/yaml/dump_spec.rb b/spec/ruby/library/yaml/dump_spec.rb index ea94b2f856..97b665d6a5 100644 --- a/spec/ruby/library/yaml/dump_spec.rb +++ b/spec/ruby/library/yaml/dump_spec.rb @@ -39,7 +39,11 @@ describe "YAML.dump" do end it "dumps an OpenStruct" do - require "ostruct" + begin + require "ostruct" + rescue LoadError + skip "OpenStruct is not available" + end os = OpenStruct.new("age" => 20, "name" => "John") yaml_dump = YAML.dump(os) diff --git a/spec/ruby/library/yaml/shared/load.rb b/spec/ruby/library/yaml/shared/load.rb index bd55332fe5..b8bb605b0a 100644 --- a/spec/ruby/library/yaml/shared/load.rb +++ b/spec/ruby/library/yaml/shared/load.rb @@ -123,7 +123,11 @@ describe :yaml_load_unsafe, shared: true do end it "loads an OpenStruct" do - require "ostruct" + begin + require "ostruct" + rescue LoadError + skip "OpenStruct is not available" + end os = OpenStruct.new("age" => 20, "name" => "John") loaded = YAML.send(@method, "--- !ruby/object:OpenStruct\ntable:\n :age: 20\n :name: John\n") loaded.should == os |