mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
parent
5987bcaa2d
commit
5895b4a7d9
1 changed files with 10 additions and 6 deletions
|
@ -1,5 +1,6 @@
|
||||||
require_relative 'helper'
|
require_relative 'helper'
|
||||||
require 'reline'
|
require 'reline'
|
||||||
|
require 'stringio'
|
||||||
|
|
||||||
class Reline::Test < Reline::TestCase
|
class Reline::Test < Reline::TestCase
|
||||||
class DummyCallbackObject
|
class DummyCallbackObject
|
||||||
|
@ -272,18 +273,21 @@ class Reline::Test < Reline::TestCase
|
||||||
assert_equal(5, Reline.point)
|
assert_equal(5, Reline.point)
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_input=
|
def test_set_input_and_output
|
||||||
# TODO
|
|
||||||
assert_raise(TypeError) do
|
assert_raise(TypeError) do
|
||||||
Reline.input = "This is not a file."
|
Reline.input = "This is not a file."
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
|
||||||
def test_output=
|
|
||||||
# TODO
|
|
||||||
assert_raise(TypeError) do
|
assert_raise(TypeError) do
|
||||||
Reline.output = "This is not a file."
|
Reline.output = "This is not a file."
|
||||||
end
|
end
|
||||||
|
Reline.input, to_write = IO.pipe
|
||||||
|
to_read, Reline.output = IO.pipe
|
||||||
|
to_write.write "a\n"
|
||||||
|
result = Reline.readline
|
||||||
|
to_write.close
|
||||||
|
read_text = to_read.read_nonblock(100)
|
||||||
|
assert_equal('a', result)
|
||||||
|
refute(read_text.empty?)
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_vi_editing_mode
|
def test_vi_editing_mode
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue