Created
November 23, 2021 00:31
-
-
Save ihumanable/ecbbe83e1add3b5f584b999cdaa6e053 to your computer and use it in GitHub Desktop.
Discord Test with Mock: Attempt 2 (Added :passthrough)
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 Discord.Test do | |
use ExUnit.Case | |
import Mock | |
describe "send_message/1" do | |
test "errors on invalid messages" do | |
with_mock Discord, [:passthrough], [validate_message: fn _ -> {:error, :bad} end] do | |
assert {:error, :bad} == Discord.send_message(%Message{}) | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment