Skip to content

Commit

Permalink
Fixed tests after rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
oltarasenko committed Sep 22, 2020
1 parent 9611e00 commit 9093601
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/crawly/engine.ex
Expand Up @@ -37,12 +37,14 @@ defmodule Crawly.Engine do
:error ->
{:error, :spider_not_found}

{:ok, pid_sup} ->
{:ok, {pid_sup, _job_tag}} ->
Supervisor.which_children(pid_sup)
|> Enum.find(&({Crawly.Manager, _, :worker, [Crawly.Manager]} = &1))
|> case do
nil -> {:error, :spider_not_found}
{_, pid, :worker, _} -> pid
{_, pid, :worker, _} ->
IO.inspect pid
pid
end
end
end
Expand Down
1 change: 1 addition & 0 deletions test/worker_test.exs
Expand Up @@ -4,6 +4,7 @@ defmodule WorkerTest do
describe "Check that worker intervals are working correctly" do
setup do
:meck.expect(Crawly.RequestsStorage, :pop, fn _ -> nil end)
:meck.expect(Crawly.RequestsStorage, :store, fn _, _ -> :ok end)

spider_name = Elixir.TestWorker

Expand Down

0 comments on commit 9093601

Please sign in to comment.