   end
 
   test "Find suitable workers for Elixir for the current OS" do
-    {_, local_os} = :os.type()
-    local_os = local_os |> Atom.to_string
-    bmf = """
-      os: #{local_os}
-      language: elixir
-    """ |> BaumeisterFile.parse!
+    {bmf, local_os} = create_bmf()
     {:ok, _worker} = Worker.start_link()
     Logger.debug "Worker is started"
     capa = Worker.detect_capabilities

  end

  test "execute a simple command" do
    {_, local_os} = :os.type()
    local_os = local_os |> Atom.to_string
    bmf = """
      os: #{local_os}
      language: elixir
      command: echo Hallo
    """ |> BaumeisterFile.parse!
    {out, rc} = Worker.execute_bmf("file:///", bmf)

    assert rc == 0

    else
      m
    end
  end

  def create_bmf(cmd \\ "true") do
    {_, local_os} = :os.type()
    local_os = local_os |> Atom.to_string
    bmf = """
      os: #{local_os}
      language: elixir
      command: #{cmd}
    """ |> BaumeisterFile.parse!
    {bmf, local_os}
  end

  @tag timeout: 1_000
