Consider the following example:
SomeMod
|> stub(:some_fun, fn _, _ -> Decimal.new(nil) end)
Here, Decimal.new(nil) should raise
** (FunctionClauseError) no function clause matching in Decimal.new/1
but what we get instead is:
** (FunctionClauseError) no function clause matching in nil.some_fun/2.
I think that's due tu this piece.
Maybe there's a way to inspect the exception and reraise if it's coming from inside stub.
Consider the following example:
Here,
Decimal.new(nil)should raise** (FunctionClauseError) no function clause matching in Decimal.new/1but what we get instead is:
** (FunctionClauseError) no function clause matching in nil.some_fun/2.I think that's due tu this piece.
Maybe there's a way to inspect the exception and reraise if it's coming from inside stub.