From f6d7afb4bd9fbdd845a3b2ed705f11bd4e002922 Mon Sep 17 00:00:00 2001 From: Fabrizio Sestito Date: Thu, 2 Jun 2022 16:54:06 +0200 Subject: [PATCH] Update tests --- test/spear_test.exs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/test/spear_test.exs b/test/spear_test.exs index daf5ecc..454295b 100644 --- a/test/spear_test.exs +++ b/test/spear_test.exs @@ -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