Skip to content

Commit

Permalink
add mock functions to info_sys_test.exs p.285 #1
Browse files Browse the repository at this point in the history
  • Loading branch information
nelsonic committed Aug 11, 2019
1 parent 3446d8d commit 6a82924
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions apps/info_sys/test/info_sys_test.exs
Original file line number Diff line number Diff line change
@@ -1,8 +1,24 @@
defmodule InfoSysTest do
use ExUnit.Case
doctest InfoSys
alias InfoSys.Result

test "greets the world" do
assert InfoSys.hello() == :world
defmodule TestBackend do
def name(), do: "Wolfram"

def compute("result", _opts) do
[%Result{backend: __MODULE__, text: "result"}]
end

def compute("none", _opts) do
[]
end

def compute("timeout", _opts) do
Process.sleep(:infinity)
end

def compute("boom", _opts) do
raise "boom!"
end
end
end

0 comments on commit 6a82924

Please sign in to comment.