summaryrefslogtreecommitdiff
path: root/test/test_simulator.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/test_simulator.rb')
-rw-r--r--test/test_simulator.rb25
1 files changed, 25 insertions, 0 deletions
diff --git a/test/test_simulator.rb b/test/test_simulator.rb
new file mode 100644
index 0000000..15691d9
--- /dev/null
+++ b/test/test_simulator.rb
@@ -0,0 +1,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 \ No newline at end of file