blob: 15691d9a0e4a133e4840b4dcca04f71c1ff74201 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
require "minitest/autorun"
require "test_helper"
require "highline/import"
require "highline/simulate"
class SimulatorTest < Minitest::Test
def setup
input = StringIO.new
output = StringIO.new
$terminal = HighLine.new(input, output)
end
def test_simulator
HighLine::Simulate.with("Bugs Bunny", "18") do
name = ask("What is your name?")
assert_equal "Bugs Bunny", name
age = ask("What is your age?")
assert_equal "18", age
end
end
end
|