diff options
author | Abinoam Praxedes Marques Jr <abinoam@gmail.com> | 2015-06-29 18:41:13 -0300 |
---|---|---|
committer | Abinoam Praxedes Marques Jr <abinoam@gmail.com> | 2015-06-29 22:39:13 -0300 |
commit | 88978cd2ff5da525f4feb81abcf32767e40790fa (patch) | |
tree | a6c353544c203e4e1ccf4b33436c6fae8d3d6fcc | |
parent | 73bb8790d499bb7d5ad6b1205e13d917e12bae38 (diff) | |
download | highline-88978cd2ff5da525f4feb81abcf32767e40790fa.tar.gz |
Add tests for HighLine::Simulator - Issue #142
As suggested by @bparanj on https://github.com/JEG2/highline/issues/142
Note: cherry picked from master and adapted to develop branch.
-rw-r--r-- | test/test_simulator.rb | 25 |
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 |