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
1 2831 | |
1 1949 | |
1 1871 | |
1 1550 | |
1 1530 | |
1 1451 | |
1 1424 | |
1 1420 | |
1 1409 | |
1 1363 |
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
Superseded by https://github.com/ihumanable/patch |
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 Twilio.Helper do | |
defmodule PhoneNumber do | |
alias Twilio.Helper.{CallerInfo, CarrierInfo} | |
defstruct [:carrier_type, | |
:carrier_name, | |
:country_code, | |
:national_format, | |
:caller_name, | |
:caller_type, |
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
test "errors on invalid messages" do | |
make_validate_message_return({:error, :bad}) | |
assert {:error, :bad} == Discord.send_message(%Message{}) | |
end |
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 |
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
~/src/discord > mix test | |
1) test send_message/1 errors on invalid messages (Discord.Test) | |
test/discord_test.exs:7 | |
** (ErlangError) Erlang error: {:undefined_function, {Discord, :validate_message, 1}} | |
code: with_mock Discord, [validate_message: fn(_message) -> {:error, :bad} end] do | |
3 tests, 1 failure |
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
~/src/discord > mix test | |
1) test send_message/1 errors on invalid messages (Discord.Test) | |
test/discord_test.exs:7 | |
** (UndefinedFunctionError) function Discord.send_message/1 is undefined | |
(module Discord is not available) | |
code: assert {:error, :bad} == Discord.send_message(%Message{}) | |
3 tests, 1 failure |
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, [:passthrough], [validate_message: fn _ -> {:error, :bad} end] do | |
assert {:error, :bad} == Discord.send_message(%Message{}) | |
end |
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
~/src/discord > mix test | |
1) test send_message/1 errors on invalid messages (Discord.Test) | |
test/discord_test.exs:7 | |
Assertion with == failed | |
code: assert {:error, :bad} == Discord.send_message(%Message{}) | |
left: {:error, :bad} | |
right: :ok | |
stacktrace: | |
test/discord_test.exs:9: (test) |
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
test "something" do | |
with_mocks([ | |
{ | |
ModuleA, | |
[:passthrough], | |
function_a: fn _ -> :ok end, | |
function_b: fn arg -> | |
{:ok, arg} | |
end | |
}, |
OlderNewer