mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 13:39:04 +02:00
Skip examples related with OpenStruct in ruby/spec
This commit is contained in:
parent
a4528f60e5
commit
ad5fa24e84
Notes:
git
2025-01-08 08:12:41 +00:00
2 changed files with 10 additions and 2 deletions
|
@ -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)
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue