Skip to content

Commit

Permalink
Example for private functions used in a mock
Browse files Browse the repository at this point in the history
  • Loading branch information
josephwilk committed Jul 14, 2013
1 parent 5f60a2e commit d51aa04
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions test/integration/mocks_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,16 @@ defmodule MocksTest do
end
end

defp drink do
:sherry
end

future_fact "mock with a private function defined inside a test" do
provided [MocksTest.Funk.hip?(drink) |> false] do
Funk.hip?(:sherry) |> falsey
end
end

fact "mock with many arguments" do
provided [MocksTest.Funk.flop?(:yes, :no, :yes) |> false] do
Funk.flop?(:yes, :no, :yes) |> falsey
Expand Down

0 comments on commit d51aa04

Please sign in to comment.