Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extra specs for YAML output #1114

Merged
merged 3 commits into from
Nov 18, 2023
Merged

Extra specs for YAML output #1114

merged 3 commits into from
Nov 18, 2023

Conversation

herwinw
Copy link
Member

@herwinw herwinw commented Nov 15, 2023

No description provided.

This output differs from the named Struct objects by omitting the
":#{class}" part.
The spec that was described as "YAML of a Class object" actually tested
an instance of a Class, update this description.
@@ -13,10 +13,18 @@
{ "a" => "b"}.to_yaml.should match_yaml("--- \na: b\n")
end

it "returns the YAML representation of a Class object" do
it "returns the YAML representation of an object" do
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@@ -59,6 +67,11 @@
Person.new("Jane", "female").to_yaml.should match_yaml("--- !ruby/struct:Person\nname: Jane\ngender: female\n")
end

it "returns the YAML representation of an unnamed Struct object" do
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
it "returns the YAML representation of an unnamed Struct object" do
it "returns the YAML representation of an unnamed Struct subclass object" do

@andrykonchin
Copy link
Member

Thank you!

@andrykonchin andrykonchin merged commit f5e9167 into ruby:master Nov 18, 2023
10 checks passed
@andrykonchin
Copy link
Member

TBH I find spec titles in this file a bit misleading because a term "object" is used.

As for me "instance" term is more correct. For instance in "returns the YAML representation of a Time object" "Time object" actually means Time itself, not Time class instance, because Time is an object as well.

@herwinw herwinw deleted the yaml_dump branch November 18, 2023 15:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants