Skip to content

Commit

Permalink
Remove dependency on Date.parse from YAML specs
Browse files Browse the repository at this point in the history
Writing it as `Date.new` is just as clear, has one less dependency and
matches the Date statements in `library/yaml/shared/load.rb`
  • Loading branch information
herwinw committed Nov 13, 2023
1 parent f3b5ec7 commit 7f7272f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion library/yaml/to_yaml_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

it "returns the YAML representation of a Date object" do
require 'date'
Date.parse('1997/12/30').to_yaml.should match_yaml("--- 1997-12-30\n")
Date.new(1997, 12, 30).to_yaml.should match_yaml("--- 1997-12-30\n")
end

it "returns the YAML representation of a FalseClass" do
Expand Down

0 comments on commit 7f7272f

Please sign in to comment.