Skip to content

Commit

Permalink
Don't use :day and :hour times as 1.13 doesn't support them yet
Browse files Browse the repository at this point in the history
  • Loading branch information
drteeth committed Dec 2, 2024
1 parent e3e1c52 commit 42399ab
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions test/event_store_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ defmodule EventStore.EventStoreTest do
@all_stream "$all"
@subscription_name "test_subscription"

@an_hour 60 * 60 * 1000
@a_day 24 * @an_hour

test "returns already started for started event store" do
assert {:error, {:already_started, _}} = EventStore.start_link()
end
Expand Down Expand Up @@ -204,7 +207,7 @@ defmodule EventStore.EventStoreTest do
end

test "override created_at" do
created_at = DateTime.utc_now() |> DateTime.add(-1, :day)
created_at = DateTime.utc_now() |> DateTime.add(-1 * @a_day)
stream_uuid = UUID.uuid4()
events = EventFactory.create_events(1)

Expand All @@ -218,8 +221,8 @@ defmodule EventStore.EventStoreTest do
end

test "override created_at existing stream" do
created_at = DateTime.utc_now() |> DateTime.add(-1, :day)
created_at2 = DateTime.utc_now() |> DateTime.add(-1, :hour)
created_at = DateTime.utc_now() |> DateTime.add(-1 * @a_day)
created_at2 = DateTime.utc_now() |> DateTime.add(-1 * @an_hour)
stream_uuid = UUID.uuid4()
events = EventFactory.create_events(1)
events2 = EventFactory.create_events(1)
Expand All @@ -240,7 +243,7 @@ defmodule EventStore.EventStoreTest do
end

test "override created_at any_version" do
created_at = DateTime.utc_now() |> DateTime.add(-1, :day)
created_at = DateTime.utc_now() |> DateTime.add(-1 * @a_day)
stream_uuid = UUID.uuid4()
events = EventFactory.create_events(1)

Expand All @@ -257,8 +260,8 @@ defmodule EventStore.EventStoreTest do
end

test "override created_at any_version existing stream" do
created_at = DateTime.utc_now() |> DateTime.add(-1, :day)
created_at2 = DateTime.utc_now() |> DateTime.add(-1, :hour)
created_at = DateTime.utc_now() |> DateTime.add(-1 * @a_day)
created_at2 = DateTime.utc_now() |> DateTime.add(-1 * @an_hour)
stream_uuid = UUID.uuid4()
events = EventFactory.create_events(1)
events2 = EventFactory.create_events(1)
Expand Down

0 comments on commit 42399ab

Please sign in to comment.