summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAbinoam P. Marques Jr <abinoam@gmail.com>2017-11-21 22:02:20 -0300
committerAbinoam P. Marques Jr <abinoam@gmail.com>2017-11-21 22:02:56 -0300
commit707af286a1e34436e9071f13219fcfa63ea42835 (patch)
tree824ef6414c732513fbd3dcba8ce0ce7429c2c93a
parent715cb2777058fd91f0a8f3a3eac6f1497a0a29cd (diff)
downloadhighline-707af286a1e34436e9071f13219fcfa63ea42835.tar.gz
Add agree with readline acceptance test
-rw-r--r--test/acceptance/at_readline_agree.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/acceptance/at_readline_agree.rb b/test/acceptance/at_readline_agree.rb
new file mode 100644
index 0000000..0a94180
--- /dev/null
+++ b/test/acceptance/at_readline_agree.rb
@@ -0,0 +1,18 @@
+# coding: utf-8
+
+require_relative "acceptance_test"
+
+HighLine::AcceptanceTest.check do |t|
+ t.desc =
+ "This step checks if the readline works well with agree.\n" \
+ "You should press <tab> and readline should give the default " \
+ "(yes/no) options to autocomplete."
+
+ t.action = proc do
+ answer = agree("Do you agree?") { |q| q.readline = true }
+ puts "You've entered -> #{answer} <-"
+ end
+
+ t.question =
+ "Did HighLine#agree worked well using question.readline = true (y/n)? "
+end