   defp success?({_scenario, {success, _}}), do: success == :ok
   defp failure?({_scenario, {success, _}}), do: success == :failed
 
-  defp run(scenario, context, background_steps, starting_state) do
-    setup = Setup.new(background_steps: background_steps, state: starting_state)
-    scenario |> Runners.run(context, setup)
-  end
-
 end


  def run(feature, context, progress_reporter) do
    %{scenarios: scenarios, background_steps: background_steps} = feature
    results = scenarios
      |> run_all_scenarios_for_context(context, background_steps)
      |> flatten_any_result_lists
      |> output_results(progress_reporter)


    }
  end

  defp run_all_scenarios_for_context(scenarios, context, setup) do
    starting_state = apply(context, :feature_state, [])
    setup_with_state = setup
      |> Map.put(:starting_state, starting_state)
    scenarios
      |> Enum.map(&run_scenario(&1,context, setup_with_state))
  end

  defp run_scenario(scenario, context, setup) do
    result = Runners.run(scenario, context, setup)
    {scenario, result}
  end

