Created
August 15, 2018 01:49
-
-
Save thiagokokada/1b58c294a9ba0e65e508d541f1d4dcab to your computer and use it in GitHub Desktop.
This file contains hidden or 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
describe "+ 1.0 * 5" do | |
defmodule FakeIO do | |
defdelegate puts(message), to: IO | |
def gets("operation> "), do: "+ 1.0\n" | |
def gets("operation> "), do: "* 5\n" | |
end | |
test "accumulator should be 1.0" do | |
run = fn -> Calculator.repl(0.0, FakeIO) end | |
assert capture_io(run) =~ "5.0" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment