From 6011b8b3f8e676d34c33ec663a59b1d560bf9442 Mon Sep 17 00:00:00 2001 From: Andrew Dryga Date: Tue, 20 Sep 2022 14:53:12 -0500 Subject: [PATCH] Slightly improve test coverage and fix a typo --- test/sage/executor_test.exs | 2 +- test/support/test_repo.ex | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/test/sage/executor_test.exs b/test/sage/executor_test.exs index d82ed10..7decbfa 100644 --- a/test/sage/executor_test.exs +++ b/test/sage/executor_test.exs @@ -915,7 +915,7 @@ defmodule Sage.ExecutorTest do end end - test "funcions are notified for all operations" do + test "functions are notified for all operations" do result = new() |> run(:step1, transaction(:t1), compensation()) diff --git a/test/support/test_repo.ex b/test/support/test_repo.ex index 0d83c0b..c5e27f8 100644 --- a/test/support/test_repo.ex +++ b/test/support/test_repo.ex @@ -1,7 +1,11 @@ defmodule TestRepo do def transaction(fun, opts) do send(self(), {:transaction, fun, opts}) - {:ok, fun.()} + + case fun.() do + {:error, reason} -> {:error, reason} + result -> {:ok, result} + end end def rollback(error) do