Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't mock Task #79

Closed
barisbalic opened this issue Dec 6, 2017 · 2 comments
Closed

Can't mock Task #79

barisbalic opened this issue Dec 6, 2017 · 2 comments

Comments

@barisbalic
Copy link

Hey, not sure if I missed something obvious but I can't seem to mock Task.

with_mock Task, [start: fn(_) -> end] do
end

Results in...

14:19:07.262 [error] GenServer #PID<0.233.0> terminating
** (stop) killed
Last message: {:EXIT, #PID<0.220.0>, :killed}
State: {:state, {#PID<0.233.0>, Supervisor.Default}, :simple_one_for_one, [{:child, :undefined, GenServer, {GenServer, :start_link, []}, :temporary, 5000, :worker, [GenServer]}], {:set, {:set, 2, 16, 16, 8, 80, 48, {[], [], [], [], [], [], [], [], [], [], [], [], [], [], [], []}, {{[], [#PID<0.241.0>], [], [], [], [], [], [], [], [], [], [#PID<0.235.0>], [], [], [], []}}}}, 3, 5, [], 0, Supervisor.Default, {[%{id: GenServer, restart: :temporary, start: {GenServer, :start_link, []}}], [strategy: :simple_one_for_one]}}

Am I doing something silly?

@Olshansk
Copy link
Collaborator

Olshansk commented Dec 7, 2017

Nothing silly, but without digging dipper, I'd be hesitant to mock Task. It's a pretty fundamental elixir module which could very well (I'm completely guessing) be used by ExUnit.

@barisbalic
Copy link
Author

Ah, now that you say that, it makes perfect sense. I didn't even think to check. I'll close this for now and looking into it myself, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants