-
Notifications
You must be signed in to change notification settings - Fork 26
Open
Description
when following the test instructions the application fails to start during mix test because the child_spec stub is not defined yet because test_helper.exs runs after the application starts and therefore the cluster attempts to start.
** (Mix) Could not start application my_app: MyApp.Application.start(:normal, []) returned an error: shutdown: failed to start child: MyApp.Cluster
** (EXIT) an exception was raised:
** (UndefinedFunctionError) function MyApp.HTTPClientMock.child_spec/1 is undefined (module MyApp.HTTPClientMock is not available)
MyApp.HTTPClientMock.child_spec([cluster: MyApp.Cluster, url: "https://localhost:9999", username: "doesnotexist", password: "notarealpassword", http_client_adapter: MyApp.HTTPClientMock])
(snap 0.10.0) lib/snap/supervisor.ex:45: Snap.Cluster.Supervisor.maybe_initialize_http_client/2
(snap 0.10.0) lib/snap/supervisor.ex:29: Snap.Cluster.Supervisor.init/1
(stdlib 5.1) supervisor.erl:330: :supervisor.init/1
(stdlib 5.1) gen_server.erl:962: :gen_server.init_it/2
(stdlib 5.1) gen_server.erl:917: :gen_server.init_it/6
(stdlib 5.1) proc_lib.erl:241: :proc_lib.init_p_do_apply/3
I've tried using Mox's compile-time requirements but it's not possible to define stubs at compile time.
Am I missing something in this approach?
Metadata
Metadata
Assignees
Labels
No labels