summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAbinoam P. Marques Jr <abinoam@gmail.com>2017-06-29 14:44:03 -0300
committerAbinoam P. Marques Jr <abinoam@gmail.com>2017-06-29 14:44:03 -0300
commit79d737565c713d7ed0b4f21a37dbed152e211e59 (patch)
tree69a5274995e9519db62dbb46f1fb3277df434825 /test
parentd1c5d73b0fc8ec38386d6fd65d9a2019e747370a (diff)
downloadhighline-79d737565c713d7ed0b4f21a37dbed152e211e59.tar.gz
Fix test_track_eof
Diffstat (limited to 'test')
-rwxr-xr-xtest/test_highline.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/test/test_highline.rb b/test/test_highline.rb
index 0bd2d99..946f110 100755
--- a/test/test_highline.rb
+++ b/test/test_highline.rb
@@ -1606,18 +1606,18 @@ class TestHighLine < Minitest::Test
def test_track_eof
assert_raises(EOFError) { @terminal.ask("Any input left? ") }
-
+
# turn EOF tracking
- old_setting = HighLine.track_eof?
+ old_instance = HighLine.default_instance
+ HighLine.default_instance = HighLine.new(StringIO.new, StringIO.new)
HighLine.track_eof = false
begin
require 'highline/import'
- HighLine.default_instance = HighLine.new(StringIO.new, StringIO.new)
ask("And now? ") # this will still blow up, nothing available
rescue
refute_equal(EOFError, $!.class) # but HighLine's safe guards are off
end
- HighLine.track_eof = old_setting
+ HighLine.default_instance = old_instance
end
def test_version