Skip to content

Commit

Permalink
Prefer to use File.open instead of Kernel.open
Browse files Browse the repository at this point in the history
  • Loading branch information
hsbt committed Dec 16, 2022
1 parent 229476b commit ed9e435
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/irb/test_history.rb
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ def assert_history(expected_history, initial_irb_history, input)
actual_history = nil
Dir.mktmpdir("test_irb_history_") do |tmpdir|
ENV["HOME"] = tmpdir
open(IRB.rc_file("_history"), "w") do |f|
File.open(IRB.rc_file("_history"), "w") do |f|
f.write(initial_irb_history)
end

Expand All @@ -182,7 +182,7 @@ def assert_history(expected_history, initial_irb_history, input)
io.save_history

io.load_history
open(IRB.rc_file("_history"), "r") do |f|
File.open(IRB.rc_file("_history"), "r") do |f|
actual_history = f.read
end
end
Expand Down

0 comments on commit ed9e435

Please sign in to comment.