Last active
December 2, 2021 23:33
-
-
Save ihumanable/2d3fd853e36d76b3069922a63c9be14f to your computer and use it in GitHub Desktop.
Discord Test with Mock: Attempt 1
This file contains 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, [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