diff options
author | matugm <matugm@gmail.com> | 2015-09-23 21:27:46 +0200 |
---|---|---|
committer | matugm <matugm@gmail.com> | 2015-09-23 21:27:46 +0200 |
commit | 482abdce7faeededddbce556fb51d80357e6cfff (patch) | |
tree | 69d1f6d74f4c3607422f481e36cbfeeb30ce369f /test/test_question_asker.rb | |
parent | dfc28843dae4365a7a310d0eaec4fba9665d93b1 (diff) | |
download | highline-482abdce7faeededddbce556fb51d80357e6cfff.tar.gz |
Make test more useful
Diffstat (limited to 'test/test_question_asker.rb')
-rw-r--r-- | test/test_question_asker.rb | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/test/test_question_asker.rb b/test/test_question_asker.rb index bdd920e..7f4c5e0 100644 --- a/test/test_question_asker.rb +++ b/test/test_question_asker.rb @@ -4,14 +4,19 @@ require_relative "../lib/highline/question_asker" class TestQuestion < Minitest::Test def setup - @highline = HighLine.new + @input = StringIO.new + @output = StringIO.new + @highline = HighLine.new(@input, @output) @question = HighLine::Question.new("How are you?", nil) @asker = HighLine::QuestionAsker.new(@question, @highline) end def test_ask_once - skip - assert_equal "", @asker.ask_once + answer = "Very good, thanks for asking!" + + @input.string = answer + + assert_equal answer, @asker.ask_once end end |