summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorGert Goet <gert@thinkcreate.nl>2024-10-11 18:34:15 +0200
committergit <svn-admin@ruby-lang.org>2024-10-11 16:34:19 +0000
commiteccfb6e60c2dba67ce5b1315a07598c2ba8b1ffb (patch)
treede073f2a4965ebe3c3af0f9258fb1213b4e7db6e /test
parent2dab59933c469e50e66ac2adc2d9bb73554e2e21 (diff)
[ruby/irb] History refactors (https://github.com/ruby/irb/pull/1013)
* Extract logic save_history in separate helper * Extract logic history_file in helper * Allow for readonly history https://github.com/ruby/irb/commit/52307f9026
Diffstat (limited to 'test')
-rw-r--r--test/irb/test_history.rb17
1 files changed, 16 insertions, 1 deletions
diff --git a/test/irb/test_history.rb b/test/irb/test_history.rb
index 7a17491d89..791eef1acd 100644
--- a/test/irb/test_history.rb
+++ b/test/irb/test_history.rb
@@ -39,6 +39,21 @@ module TestIRB
include IRB::HistorySavingAbility
end
+ def test_history_dont_save
+ omit "Skip Editline" if /EditLine/n.match(Readline::VERSION)
+ IRB.conf[:SAVE_HISTORY] = nil
+ assert_history(<<~EXPECTED_HISTORY, <<~INITIAL_HISTORY, <<~INPUT)
+ 1
+ 2
+ EXPECTED_HISTORY
+ 1
+ 2
+ INITIAL_HISTORY
+ 3
+ exit
+ INPUT
+ end
+
def test_history_save_1
omit "Skip Editline" if /EditLine/n.match(Readline::VERSION)
IRB.conf[:SAVE_HISTORY] = 1
@@ -166,7 +181,7 @@ module TestIRB
IRB.conf[:HISTORY_FILE] = "fake/fake/fake/history_file"
io = TestInputMethodWithRelineHistory.new
- assert_warn(/history file does not exist/) do
+ assert_warn(/ensure the folder exists/i) do
io.save_history
end