Skip to content

Instantly share code, notes, and snippets.

@ihumanable
Created November 23, 2021 00:37
Show Gist options
  • Save ihumanable/eba867b87c309cdc68c6ee04630fde34 to your computer and use it in GitHub Desktop.
Save ihumanable/eba867b87c309cdc68c6ee04630fde34 to your computer and use it in GitHub Desktop.
Invalid Message Test Case with Patch
defmodule Discord.Test do
use ExUnit.Case
use Patch
describe "send_message/1" do
test "errors on invalid messages" do
patch(Discord, :validate_message, {:error, :bad})
assert {:error, :bad} == Discord.send_message(%Message{})
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment