Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
fabriziosestito committed Jun 2, 2022
1 parent dd90252 commit f6d7afb
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions test/spear_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,14 @@ defmodule SpearTest do
end

test "an empty expectation will fail on the wrong stream revision", c do
assert {:error, reason} = Spear.append([random_event()], c.conn, c.stream_name, expect: 3)
wrong_expected_revision = Enum.random(0..5)

assert reason == %Spear.ExpectationViolation{current: 6, expected: 3}
assert {:error, reason} =
Spear.append([random_event()], c.conn, c.stream_name,
expect: wrong_expected_revision
)

assert reason == %Spear.ExpectationViolation{current: 6, expected: wrong_expected_revision}
end

test "a stream may be streamed backwards", c do
Expand Down

0 comments on commit f6d7afb

Please sign in to comment.