im trying to setup some unit tests with Elixir but running into this error below. What am I doing wrong?
cannot invoke remote function PropertyManager.Database.get/0 inside match
Here is my code:
property_manager_test.exs
defmodule PropertyManagerTest do
use ExUnit.Case
test "the truth" do
assert 1 + 1 == 2
end
test "get value from db" do
assert PropertyManager.Database.get() = "test this"
end
end
database.ex
defmodule PropertyManager.Database do
def get do
"test this"
end
end
Try with ==
instead of =
What you're doing in your code is a pattern match, which means it will try to match the right side to the pattern on the left side. A pattern can't contain function calls, which is probably the cause of your error.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With