summaryrefslogtreecommitdiff
path: root/test/test_simulator.rb
blob: dffeb88b79fc4f92c9080a29bf0c8c3b8f5ceb9b (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
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