|
1 | 1 | defmodule PoolexTest do
|
2 | 2 | use ExUnit.Case, async: false
|
3 |
| - import PoolHelpers |
4 | 3 |
|
5 |
| - doctest Poolex |
| 4 | + import PoolHelpers |
6 | 5 |
|
7 | 6 | alias Poolex.Private.DebugInfo
|
8 | 7 |
|
| 8 | + doctest Poolex |
| 9 | + |
9 | 10 | describe "debug info" do
|
10 | 11 | test "valid after initialization" do
|
11 | 12 | initial_fun = fn -> 0 end
|
@@ -202,12 +203,9 @@ defmodule PoolexTest do
|
202 | 203 | test "works on callers" do
|
203 | 204 | pool_name = start_pool(worker_module: SomeWorker, workers_count: 1)
|
204 | 205 |
|
205 |
| - 1..10 |
206 |
| - |> Enum.each(fn _ -> |
| 206 | + Enum.each(1..10, fn _ -> |
207 | 207 | spawn(fn ->
|
208 |
| - Poolex.run(pool_name, fn pid -> |
209 |
| - GenServer.call(pid, {:do_some_work_with_delay, :timer.seconds(4)}) |
210 |
| - end) |
| 208 | + Poolex.run(pool_name, fn pid -> GenServer.call(pid, {:do_some_work_with_delay, :timer.seconds(4)}) end) |
211 | 209 | end)
|
212 | 210 | end)
|
213 | 211 |
|
@@ -523,21 +521,13 @@ defmodule PoolexTest do
|
523 | 521 | assert Poolex.child_spec(pool_id: :test_pool, worker_module: SomeWorker, workers_count: 5) ==
|
524 | 522 | %{
|
525 | 523 | id: :test_pool,
|
526 |
| - start: |
527 |
| - {Poolex, :start_link, |
528 |
| - [[pool_id: :test_pool, worker_module: SomeWorker, workers_count: 5]]} |
| 524 | + start: {Poolex, :start_link, [[pool_id: :test_pool, worker_module: SomeWorker, workers_count: 5]]} |
529 | 525 | }
|
530 | 526 |
|
531 |
| - assert Poolex.child_spec( |
532 |
| - pool_id: {:global, :biba}, |
533 |
| - worker_module: SomeWorker, |
534 |
| - workers_count: 10 |
535 |
| - ) == |
| 527 | + assert Poolex.child_spec(pool_id: {:global, :biba}, worker_module: SomeWorker, workers_count: 10) == |
536 | 528 | %{
|
537 | 529 | id: {:global, :biba},
|
538 |
| - start: |
539 |
| - {Poolex, :start_link, |
540 |
| - [[pool_id: {:global, :biba}, worker_module: SomeWorker, workers_count: 10]]} |
| 530 | + start: {Poolex, :start_link, [[pool_id: {:global, :biba}, worker_module: SomeWorker, workers_count: 10]]} |
541 | 531 | }
|
542 | 532 | end
|
543 | 533 | end
|
@@ -681,9 +671,7 @@ defmodule PoolexTest do
|
681 | 671 | ExUnit.Callbacks.start_supervised({Registry, [keys: :unique, name: TestRegistry]})
|
682 | 672 | name = {:via, Registry, {TestRegistry, "pool"}}
|
683 | 673 |
|
684 |
| - ExUnit.Callbacks.start_supervised( |
685 |
| - {Poolex, [pool_id: name, worker_module: SomeWorker, workers_count: 5]} |
686 |
| - ) |
| 674 | + ExUnit.Callbacks.start_supervised({Poolex, [pool_id: name, worker_module: SomeWorker, workers_count: 5]}) |
687 | 675 |
|
688 | 676 | state = Poolex.get_state(name)
|
689 | 677 |
|
|
0 commit comments