diff options
author | Abinoam P. Marques Jr <abinoam@gmail.com> | 2023-01-01 14:00:16 -0300 |
---|---|---|
committer | Abinoam P. Marques Jr <abinoam@gmail.com> | 2023-01-01 14:00:16 -0300 |
commit | bf7ad58dceb5eba1b54461c402375cb711468b2c (patch) | |
tree | 30d6d1a7b36bd23ec62ce74a8cd2f4f5ed178cdd /test | |
parent | 078490a4b250008b0f762bceae67018f5f1864f9 (diff) | |
download | highline-bf7ad58dceb5eba1b54461c402375cb711468b2c.tar.gz |
Document the new Question#default_hint_show
Diffstat (limited to 'test')
-rwxr-xr-x | test/test_highline.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/test/test_highline.rb b/test/test_highline.rb index aeb41ca..13ff406 100755 --- a/test/test_highline.rb +++ b/test/test_highline.rb @@ -846,6 +846,21 @@ class TestHighLine < Minitest::Test end assert_equal default_non_string_object, answer + assert_equal "Question: |#{default_non_string_object}| ", @output.string + + @input.truncate(@input.rewind) + @input << "\n" + @input.rewind + @output.truncate(@output.rewind) + + default_non_string_object = Object.new + + answer = @terminal.ask("Question: ") do |q| + q.default = default_non_string_object + q.default_hint_show = false + end + + assert_equal default_non_string_object, answer assert_equal "Question: ", @output.string end |