conductor_test.exs 766 Bytes
Newer Older
1 2 3 4
defmodule ConductorTest do

  use ExUnit.Case, async: true

5
  alias Grengine.{Conductor, Performance, PerformanceSupervisor}
6 7 8 9 10 11 12

  describe "finding all performances" do

    setup do
      PerformanceSupervisor.start_link
      PerformanceSupervisor.start_performance("foo")
      PerformanceSupervisor.start_performance("bar")
13
      Performance.set_values("foo", %{s1: 42})
14 15 16 17 18 19 20 21 22 23 24 25 26
      :ok

    end

    test "get all running performances" do
      foo = Conductor.get_performances()
      assert is_list(foo)
      assert length(foo) == 2
      # assert [{:n, :l, {:performance, "foo"}}] == foo
    end

    test "handle single performance" do
      values = Conductor.perform()
27 28
      assert is_map(values)
      assert length(Map.keys(values)) == 1
29 30 31 32 33 34 35
    end

  end



end