Skip to content

Instantly share code, notes, and snippets.

@josephwilk
Created October 30, 2013 18:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save josephwilk/7237222 to your computer and use it in GitHub Desktop.
Save josephwilk/7237222 to your computer and use it in GitHub Desktop.
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