diff --git a/lib/mox.ex b/lib/mox.ex index c8952f0..fedace5 100644 --- a/lib/mox.ex +++ b/lib/mox.ex @@ -576,7 +576,11 @@ defmodule Mox do end defmock(MyApp.MockWeatherAPI, for: MyApp.WeatherAPI) - stub_with(MyApp.MockWeatherAPI, MyApp.StubWeatherAPI) + + setup do + stub_with(MyApp.MockWeatherAPI, MyApp.StubWeatherAPI) + :ok + end This is the same as calling `stub/3` for each callback in `MyApp.MockWeatherAPI`: