Hi, thanks for the feedback, I appreciate it
isolate_envoption is an option to isolate application env. That’s to limit the scope ofApplication.get_envandApplication.put_envfunctions. See Repatch.Application — Repatch v1.6.1- You should pass a
modeoption to theexpectcall, likeexpect(Date, :utc_today, [mode: :shared, exactly: 2], fn -> ~D[2023-04-06] end)
So
-
I will improve the documentation about this
isolate_envoption. -
And since I can see that you wanted to pass the default mode option on the
use Repatch.ExUnitI think I will consider something likedefault_modeoption, but I my biggest argument against this is that it is less explicit and reader of the test will be confused if this patch is local, shared or global unless they check one of the many line in the head of the modulePerhaps I can implement some
setupin theuse Repatch.ExUnitto take the mode from test tag, like@tag repatch_mode: :shared test "..." do Repatch.patch(DateTime, :utc_now, fn -> :ok end) # <- this patch is shared mode now end
Share your ideas if you have any






















