   then_ "starting state was correct", fn %{starting_state: :yes} = state ->
     {:ok, state}
   end
+
+  then_ "scenario_starting_state only ran once", fn %{starting_state_run_count: 1} = state ->
+    {:ok, state}
+  end
+
+  then_ "scenario_finalize doesnt run until the end", fn state ->
+    unless Process.get(:finalized, false) do
+      {:ok, state}
+    else
+      {:error, :already_finalized}
+    end
+  end
 end

  when_ "step two", fn :step_one_complete ->
    {:ok, :step_two_complete}
  end

  when_ "make a failing asserstion", fn _state ->
    assert 1 == 0

    {_, _error} = scenario |> WhiteBread.Runners.run(ExampleContext)
    assert Process.get(:finalized) == true
  end

  test "Scenario finalize doesn't run till the end of scenario" do
    steps = [
      %Steps.When{text: "step one"},
      %Steps.When{text: "step two"},
      %Steps.Then{text: "scenario_finalize doesnt run until the end"},
    ]
    scenario = %Scenario{name: "test scenario", steps: steps}

    {result, _error} = scenario |> WhiteBread.Runners.run(ExampleContext)
    assert result == :ok
  end
end

defmodule WhiteBread.ScenarioRunnerTest.ExampleContext do
  use WhiteBread.Context

  scenario_starting_state fn global_state ->
    %{starting_state: :yes, starting_state_run_count: (global_state |> Dict.get(:starting_state_run_count, 0)) + 1}
  end

  scenario_finalize fn ->
