Closed axelson closed 5 years ago
--
José Valim www.plataformatec.com.br Skype: jv.ptec Founder and Director of R&D
Okay, updated with a version check to set the tags to exclude.
Perfect. Although I think we should get the first entry (self()) in case of no matches (the current behavior). --
José Valimwww.plataformatec.com.br http://www.plataformatec.com.br/Founder and Director of R&D
I still need to fix up the assert_default_raise
in the tests but I've updated the main check in server.ex to reflect "Although I think we should get the first entry (self()) in case of no matches (the current behavior)."
But isn't defaulting to the last caller (which will be the test process in these cases) cleaner?
owner_pid = Enum.find_value(caller_pids, List.last(caller_pids), fn caller_pid ->
state.allowances[caller_pid][mock]
end)
But isn't defaulting to the last caller (which will be the test process in these cases) cleaner?
I don't think it matters in the current code because the only scenario where it will use the default is when we don't have any allowances or expectations and that means both first or last will fail anyway?
:heart: :green_heart: :blue_heart: :yellow_heart: :purple_heart:
Awesome, thanks!
My first implementation passed the result of
Process.get(:"$callers")
in to the server for processing but it felt cleaner to do that call inMox
itself.Questions:
$callers
set?assert_default_raise/2
System.version/0
$callers
documented anywhere besides the Elixir 1.8 release notes?