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

Cleanup of YAML specs #1108

Merged
merged 4 commits into from
Nov 12, 2023
Merged

Cleanup of YAML specs #1108

merged 4 commits into from
Nov 12, 2023

Conversation

herwinw
Copy link
Member

@herwinw herwinw commented Nov 12, 2023

  • Fix confusion over instance and class variables in descriptions
  • Remove globals

Replace it with a call to `fixture`.
Use instance variables and before/after blocks instead.
The only line left was `require "yaml"`, use that inline.
YAML.dump( ['badger', 'elephant', 'tiger'], io )
end
YAML.load_file($test_file).should == ['badger', 'elephant', 'tiger']
YAML.load_file(@test_file).should == ['badger', 'elephant', 'tiger']
end
Copy link
Member

Choose a reason for hiding this comment

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

suggestion: $test_file was used in one case only - it makes sense not to create and delete file for every other cases.

@andrykonchin
Copy link
Member

Thank you!

@andrykonchin andrykonchin merged commit b4e426c into ruby:master Nov 12, 2023
10 checks passed
@herwinw herwinw deleted the yaml branch November 12, 2023 18:37
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