Skip to content

Commit

Permalink
Use assert_separately
Browse files Browse the repository at this point in the history
  • Loading branch information
tdeo committed Nov 19, 2024
1 parent c3cebc1 commit a50d82e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
3 changes: 1 addition & 2 deletions lib/psych/class_loader.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
# frozen_string_literal: true
require_relative 'omap'
require_relative 'set'

autoload :Date, "date"
require 'date'

module Psych
class ClassLoader # :nodoc:
Expand Down
7 changes: 4 additions & 3 deletions test/psych/test_string.rb
Original file line number Diff line number Diff line change
Expand Up @@ -224,9 +224,10 @@ def test_string_with_ivars
end

def test_string_matching_date
yml = `ruby -r ./lib/psych -e "puts Psych.dump('2024-11-19')"`
assert_match "'2024-11-19'", yml
assert_equal '2024-11-19', Psych.load(yml)
assert_separately(%w[-r ./lib/psych], <<~RUBY)
yml = Psych.dump('2024-11-19')
assert_equal '2024-11-19', Psych.load(yml)
RUBY
end

def test_binary
Expand Down

0 comments on commit a50d82e

Please sign in to comment.