diff --git a/test/irb/test_history.rb b/test/irb/test_history.rb index fef42b498..97c5baa35 100644 --- a/test/irb/test_history.rb +++ b/test/irb/test_history.rb @@ -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)