Skip to content

Commit

Permalink
Add tests for HighLine::Simulator - Issue #142
Browse files Browse the repository at this point in the history
As suggested by @bparanj on #142
  • Loading branch information
abinoam committed Jun 29, 2015
1 parent 60bfde3 commit dea6a46
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions test/tc_simulator.rb
@@ -0,0 +1,23 @@
require 'test/unit'
require 'highline/import'
require 'highline/simulate'

class SimulatorTest < Test::Unit::TestCase
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

0 comments on commit dea6a46

Please sign in to comment.