Skip to content

Commit

Permalink
added test for when the history_file does not exist
Browse files Browse the repository at this point in the history
  • Loading branch information
ignacio-chiazzo committed Feb 2, 2024
1 parent 9bf0242 commit 05dfbd1
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions test/irb/test_history.rb
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,20 @@ def test_history_different_encodings
$VERBOSE = verbose_bak
end

def test_history_does_not_raise_when_history_file_directory_does_not_exist
IRB.conf[:SAVE_HISTORY] = 1
IRB.conf[:HISTORY_FILE] = "fake/fake/fake/history_file"
io = TestInputMethodWithRelineHistory.new
io.class::HISTORY.clear
io.load_history
io.class::HISTORY << 'line1'
io.class::HISTORY << 'line2'

assert_nothing_raised do
io.save_history
end
end

private

def history_concurrent_use_for_input_method(input_method)
Expand Down

0 comments on commit 05dfbd1

Please sign in to comment.