-
Notifications
You must be signed in to change notification settings - Fork 45
Open
Description
Issue
Trying to stub the Integer.to_string/2 method does not work.
Environment
- Elixir 1.11.4 (compiled with Erlang/OTP 23)
- Erlang/OTP 24 [erts-12.0.3] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [jit]
Steps to reproduce
# test_helper.exs
Mimic.copy(Integer)
ExUnit.start()# test/sometest.exs
defmodule SomeTest do
use ExUnit.Case
use Mimic
test "greets the world" do
stub(Integer, :to_string, fn _ -> "STUB" end)
stub(Integer, :to_string, fn _, _ -> "STUB" end)
random = Integer.to_string(5)
assert random == "STUB"
end
endIt seems the above test will fail, but if it's for some other method, like Integer.digits/1 it passes.
Not really sure what could be the issue without further investigation. 🤔
EDIT: I'll be more than happy to open an example repo reproducing the issue 😄
Metadata
Metadata
Assignees
Labels
No labels