Created
October 30, 2013 18:04
-
-
Save josephwilk/7237222 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
defmodule AmTestTest do | |
use Amrita.Sweet | |
def user_pid do | |
{:ok, pid} = User.start_link("test") | |
end | |
#Works since user_pid is a fn that can be resolved as part of current module | |
fact "the truth" do | |
provided [Repo.find_by_email("test") |> user_pid] do | |
Login.execute("test") | |
end | |
end | |
#Fails due to local pid not being resolvable within provided. | |
fact "the truth" do | |
pid = User.start_link("test") | |
provided [Repo.find_by_email("test") |> pid] do | |
Login.execute("test") | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment