mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
[ruby/reline] Add a test for dialog proc with context
https://github.com/ruby/reline/commit/2ce2696d6e
This commit is contained in:
parent
bb12281164
commit
7572e0c6ec
1 changed files with 14 additions and 0 deletions
|
@ -338,6 +338,20 @@ class Reline::Test < Reline::TestCase
|
||||||
assert_equal(dummy, d.dialog_proc)
|
assert_equal(dummy, d.dialog_proc)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_add_dialog_proc_with_context
|
||||||
|
dummy_proc = proc {}
|
||||||
|
array = Array.new
|
||||||
|
Reline.add_dialog_proc(:test_proc, dummy_proc, array)
|
||||||
|
d = Reline.dialog_proc(:test_proc)
|
||||||
|
assert_equal(dummy_proc, d.dialog_proc)
|
||||||
|
assert_equal(array, d.context)
|
||||||
|
|
||||||
|
Reline.add_dialog_proc(:test_proc, dummy_proc, nil)
|
||||||
|
d = Reline.dialog_proc(:test_proc)
|
||||||
|
assert_equal(dummy_proc, d.dialog_proc)
|
||||||
|
assert_equal(nil, d.context)
|
||||||
|
end
|
||||||
|
|
||||||
def test_readmultiline
|
def test_readmultiline
|
||||||
# readmultiline is module function
|
# readmultiline is module function
|
||||||
assert_include(Reline.methods, :readmultiline)
|
assert_include(Reline.methods, :readmultiline)
|
||||||
|
|
Loading…
Reference in a new issue