summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorMarc-Andre Lafortune <github@marc-andre.ca>2020-09-26 01:27:23 -0400
committerMarc-André Lafortune <github@marc-andre.ca>2020-09-30 18:11:24 -0400
commitb36a45c05cafc227ade3b59349482953321d6a89 (patch)
treed166ac4aa87cab243740e599dc186c23e2c4ce1a /spec
parent0e93118c44fc4128bcacfe1dc6702c84a84b862b (diff)
[ruby/ostruct] Improved YAML serialization.
Patch adapted from Pietro Monteiro [Fixes bug#8382]
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/3593
Diffstat (limited to 'spec')
-rw-r--r--spec/ruby/library/yaml/dump_spec.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/spec/ruby/library/yaml/dump_spec.rb b/spec/ruby/library/yaml/dump_spec.rb
index 5af794b7f8..9e884b0fd7 100644
--- a/spec/ruby/library/yaml/dump_spec.rb
+++ b/spec/ruby/library/yaml/dump_spec.rb
@@ -37,7 +37,9 @@ describe "YAML.dump" do
it "dumps an OpenStruct" do
require "ostruct"
os = OpenStruct.new("age" => 20, "name" => "John")
- YAML.dump(os).should match_yaml("--- !ruby/object:OpenStruct\ntable:\n :age: 20\n :name: John\n")
+ os2 = YAML.load(YAML.dump(os))
+ os2.age.should == 20
+ os2.name.should == "John"
end
it "dumps a File without any state" do