summaryrefslogtreecommitdiff
path: root/test/acceptance/at_echo_false.rb
blob: 2466b8d7e2c914034c8db796f3ab2c15f84dd0a2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# coding: utf-8

require_relative 'acceptance_test'

HighLine::AcceptanceTest.check do |t|
  t.desc =
    "This step checks if the 'echo = false' " \
    "setting is effective in hiding the user " \
    "typed characters.\n" \
    "This functionality is useful when asking " \
    "for passwords.\n" \
    "When typing the characters you should not " \
    "see any of them on the screen."

  t.action = Proc.new do
    answer = ask "Enter some characters and press <enter>: " do |q|
      q.echo = false
    end
    puts "You've entered -> #{answer} <-"
  end

  t.question = "Were the characters adequately hidden when you typed them (y/n)? "
end