Skip to content

Commit

Permalink
Slightly improve test coverage and fix a typo
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewDryga committed Sep 20, 2022
1 parent d73f988 commit 6011b8b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion test/sage/executor_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down
6 changes: 5 additions & 1 deletion test/support/test_repo.ex
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 6011b8b

Please sign in to comment.