Created
September 25, 2014 03:17
-
-
Save jcasimir/7e595face5a2985fa286 to your computer and use it in GitHub Desktop.
manual stubbing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Game | |
def get_input | |
gets.chomp | |
end | |
def play | |
unless get_input == "quit" | |
puts "Still Going" | |
end | |
return "done" | |
end | |
end | |
class GameTest < Minitest::Test | |
def test_it_exits | |
class Game | |
def get_input | |
"quit" | |
end | |
end | |
assert_equal "done", Game.new.play | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment