Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
brianberlin committed Sep 22, 2023
1 parent f878620 commit 8abc999
Show file tree
Hide file tree
Showing 10 changed files with 391 additions and 391 deletions.
102 changes: 51 additions & 51 deletions test/cocktail/daily_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ defmodule Cocktail.DailyTest do
|> Enum.take(3)

assert equivalent_times?(times, [
~Y[2017-01-01 06:00:00 America/Los_Angeles],
~Y[2017-01-02 06:00:00 America/Los_Angeles],
~Y[2017-01-03 06:00:00 America/Los_Angeles]
])
~Y[2017-01-01 06:00:00 America/Los_Angeles],
~Y[2017-01-02 06:00:00 America/Los_Angeles],
~Y[2017-01-03 06:00:00 America/Los_Angeles]
])
end

test "Every 2 days" do
Expand All @@ -30,10 +30,10 @@ defmodule Cocktail.DailyTest do
|> Enum.take(3)

assert equivalent_times?(times, [
~Y[2017-01-01 06:00:00 America/Los_Angeles],
~Y[2017-01-03 06:00:00 America/Los_Angeles],
~Y[2017-01-05 06:00:00 America/Los_Angeles]
])
~Y[2017-01-01 06:00:00 America/Los_Angeles],
~Y[2017-01-03 06:00:00 America/Los_Angeles],
~Y[2017-01-05 06:00:00 America/Los_Angeles]
])
end

test "Every 2 days / Every 3 days" do
Expand All @@ -46,14 +46,14 @@ defmodule Cocktail.DailyTest do
|> Enum.take(7)

assert equivalent_times?(times, [
~Y[2017-01-01 06:00:00 America/Los_Angeles],
~Y[2017-01-03 06:00:00 America/Los_Angeles],
~Y[2017-01-04 06:00:00 America/Los_Angeles],
~Y[2017-01-05 06:00:00 America/Los_Angeles],
~Y[2017-01-07 06:00:00 America/Los_Angeles],
~Y[2017-01-09 06:00:00 America/Los_Angeles],
~Y[2017-01-10 06:00:00 America/Los_Angeles]
])
~Y[2017-01-01 06:00:00 America/Los_Angeles],
~Y[2017-01-03 06:00:00 America/Los_Angeles],
~Y[2017-01-04 06:00:00 America/Los_Angeles],
~Y[2017-01-05 06:00:00 America/Los_Angeles],
~Y[2017-01-07 06:00:00 America/Los_Angeles],
~Y[2017-01-09 06:00:00 America/Los_Angeles],
~Y[2017-01-10 06:00:00 America/Los_Angeles]
])
end

test "Daily; overridden start time" do
Expand All @@ -65,10 +65,10 @@ defmodule Cocktail.DailyTest do
|> Enum.take(3)

assert equivalent_times?(times, [
~Y[2017-08-02 06:00:00 America/Los_Angeles],
~Y[2017-08-03 06:00:00 America/Los_Angeles],
~Y[2017-08-04 06:00:00 America/Los_Angeles]
])
~Y[2017-08-02 06:00:00 America/Los_Angeles],
~Y[2017-08-03 06:00:00 America/Los_Angeles],
~Y[2017-08-04 06:00:00 America/Los_Angeles]
])
end

test "Daily on the 10th and 14th hours of the day" do
Expand All @@ -80,12 +80,12 @@ defmodule Cocktail.DailyTest do
|> Enum.take(5)

assert equivalent_times?(times, [
~Y[2017-01-01 10:00:00 America/Los_Angeles],
~Y[2017-01-01 14:00:00 America/Los_Angeles],
~Y[2017-01-02 10:00:00 America/Los_Angeles],
~Y[2017-01-02 14:00:00 America/Los_Angeles],
~Y[2017-01-03 10:00:00 America/Los_Angeles]
])
~Y[2017-01-01 10:00:00 America/Los_Angeles],
~Y[2017-01-01 14:00:00 America/Los_Angeles],
~Y[2017-01-02 10:00:00 America/Los_Angeles],
~Y[2017-01-02 14:00:00 America/Los_Angeles],
~Y[2017-01-03 10:00:00 America/Los_Angeles]
])
end

test "Every 6 days on Mondays and Fridays" do
Expand All @@ -97,15 +97,15 @@ defmodule Cocktail.DailyTest do
|> Enum.take(8)

assert equivalent_times?(times, [
~Y[2017-01-13 06:00:00 America/Los_Angeles],
~Y[2017-02-06 06:00:00 America/Los_Angeles],
~Y[2017-02-24 06:00:00 America/Los_Angeles],
~Y[2017-03-20 06:00:00 America/Los_Angeles],
~Y[2017-04-07 06:00:00 America/Los_Angeles],
~Y[2017-05-01 06:00:00 America/Los_Angeles],
~Y[2017-05-19 06:00:00 America/Los_Angeles],
~Y[2017-06-12 06:00:00 America/Los_Angeles]
])
~Y[2017-01-13 06:00:00 America/Los_Angeles],
~Y[2017-02-06 06:00:00 America/Los_Angeles],
~Y[2017-02-24 06:00:00 America/Los_Angeles],
~Y[2017-03-20 06:00:00 America/Los_Angeles],
~Y[2017-04-07 06:00:00 America/Los_Angeles],
~Y[2017-05-01 06:00:00 America/Los_Angeles],
~Y[2017-05-19 06:00:00 America/Los_Angeles],
~Y[2017-06-12 06:00:00 America/Los_Angeles]
])
end

test "Daily on Mondays and Fridays on the 10th and 14th hours of the day" do
Expand All @@ -117,12 +117,12 @@ defmodule Cocktail.DailyTest do
|> Enum.take(5)

assert equivalent_times?(times, [
~Y[2017-01-02 10:00:00 America/Los_Angeles],
~Y[2017-01-02 14:00:00 America/Los_Angeles],
~Y[2017-01-06 10:00:00 America/Los_Angeles],
~Y[2017-01-06 14:00:00 America/Los_Angeles],
~Y[2017-01-09 10:00:00 America/Los_Angeles]
])
~Y[2017-01-02 10:00:00 America/Los_Angeles],
~Y[2017-01-02 14:00:00 America/Los_Angeles],
~Y[2017-01-06 10:00:00 America/Los_Angeles],
~Y[2017-01-06 14:00:00 America/Los_Angeles],
~Y[2017-01-09 10:00:00 America/Los_Angeles]
])
end

test "Daily on Mondays and Fridays on the 10th and 14th hours of the day on the 15th and 45th minutes of the hour on the 0th and 30th seconds of the minute" do
Expand All @@ -140,16 +140,16 @@ defmodule Cocktail.DailyTest do
|> Enum.take(9)

assert equivalent_times?(times, [
~Y[2017-01-02 10:15:00 America/Los_Angeles],
~Y[2017-01-02 10:15:30 America/Los_Angeles],
~Y[2017-01-02 10:45:00 America/Los_Angeles],
~Y[2017-01-02 10:45:30 America/Los_Angeles],
~Y[2017-01-02 14:15:00 America/Los_Angeles],
~Y[2017-01-02 14:15:30 America/Los_Angeles],
~Y[2017-01-02 14:45:00 America/Los_Angeles],
~Y[2017-01-02 14:45:30 America/Los_Angeles],
~Y[2017-01-06 10:15:00 America/Los_Angeles]
])
~Y[2017-01-02 10:15:00 America/Los_Angeles],
~Y[2017-01-02 10:15:30 America/Los_Angeles],
~Y[2017-01-02 10:45:00 America/Los_Angeles],
~Y[2017-01-02 10:45:30 America/Los_Angeles],
~Y[2017-01-02 14:15:00 America/Los_Angeles],
~Y[2017-01-02 14:15:30 America/Los_Angeles],
~Y[2017-01-02 14:45:00 America/Los_Angeles],
~Y[2017-01-02 14:45:30 America/Los_Angeles],
~Y[2017-01-06 10:15:00 America/Los_Angeles]
])
end

test "generating occurrences when when add_recurrence_time is used" do
Expand Down
8 changes: 4 additions & 4 deletions test/cocktail/edge_cases_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ defmodule Cocktail.EdgeCasesTest do
times = schedule |> Schedule.occurrences(~N[2017-09-01 00:00:00]) |> Enum.take(3)

assert equivalent_times?(times, [
~N[2017-10-01 09:00:00],
~N[2017-10-02 09:00:00],
~N[2017-10-03 09:00:00]
])
~N[2017-10-01 09:00:00],
~N[2017-10-02 09:00:00],
~N[2017-10-03 09:00:00]
])
end
end
84 changes: 42 additions & 42 deletions test/cocktail/hourly_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ defmodule Cocktail.HourlyTest do
|> Enum.take(3)

assert equivalent_times?(times, [
~Y[2017-01-01 06:00:00 America/Los_Angeles],
~Y[2017-01-01 07:00:00 America/Los_Angeles],
~Y[2017-01-01 08:00:00 America/Los_Angeles]
])
~Y[2017-01-01 06:00:00 America/Los_Angeles],
~Y[2017-01-01 07:00:00 America/Los_Angeles],
~Y[2017-01-01 08:00:00 America/Los_Angeles]
])
end

test "Every 2 hours" do
Expand All @@ -30,10 +30,10 @@ defmodule Cocktail.HourlyTest do
|> Enum.take(3)

assert equivalent_times?(times, [
~Y[2017-01-01 06:00:00 America/Los_Angeles],
~Y[2017-01-01 08:00:00 America/Los_Angeles],
~Y[2017-01-01 10:00:00 America/Los_Angeles]
])
~Y[2017-01-01 06:00:00 America/Los_Angeles],
~Y[2017-01-01 08:00:00 America/Los_Angeles],
~Y[2017-01-01 10:00:00 America/Los_Angeles]
])
end

test "Every 2 hours / Every 3 hours" do
Expand All @@ -46,14 +46,14 @@ defmodule Cocktail.HourlyTest do
|> Enum.take(7)

assert equivalent_times?(times, [
~Y[2017-01-01 06:00:00 America/Los_Angeles],
~Y[2017-01-01 08:00:00 America/Los_Angeles],
~Y[2017-01-01 09:00:00 America/Los_Angeles],
~Y[2017-01-01 10:00:00 America/Los_Angeles],
~Y[2017-01-01 12:00:00 America/Los_Angeles],
~Y[2017-01-01 14:00:00 America/Los_Angeles],
~Y[2017-01-01 15:00:00 America/Los_Angeles]
])
~Y[2017-01-01 06:00:00 America/Los_Angeles],
~Y[2017-01-01 08:00:00 America/Los_Angeles],
~Y[2017-01-01 09:00:00 America/Los_Angeles],
~Y[2017-01-01 10:00:00 America/Los_Angeles],
~Y[2017-01-01 12:00:00 America/Los_Angeles],
~Y[2017-01-01 14:00:00 America/Los_Angeles],
~Y[2017-01-01 15:00:00 America/Los_Angeles]
])
end

test "Hourly; overridden start time" do
Expand All @@ -65,10 +65,10 @@ defmodule Cocktail.HourlyTest do
|> Enum.take(3)

assert equivalent_times?(times, [
~Y[2017-08-01 12:00:00 America/Los_Angeles],
~Y[2017-08-01 13:00:00 America/Los_Angeles],
~Y[2017-08-01 14:00:00 America/Los_Angeles]
])
~Y[2017-08-01 12:00:00 America/Los_Angeles],
~Y[2017-08-01 13:00:00 America/Los_Angeles],
~Y[2017-08-01 14:00:00 America/Los_Angeles]
])
end

test "Hourly on the 10th and 14th hours of the day" do
Expand All @@ -80,12 +80,12 @@ defmodule Cocktail.HourlyTest do
|> Enum.take(5)

assert equivalent_times?(times, [
~Y[2017-01-01 10:00:00 America/Los_Angeles],
~Y[2017-01-01 14:00:00 America/Los_Angeles],
~Y[2017-01-02 10:00:00 America/Los_Angeles],
~Y[2017-01-02 14:00:00 America/Los_Angeles],
~Y[2017-01-03 10:00:00 America/Los_Angeles]
])
~Y[2017-01-01 10:00:00 America/Los_Angeles],
~Y[2017-01-01 14:00:00 America/Los_Angeles],
~Y[2017-01-02 10:00:00 America/Los_Angeles],
~Y[2017-01-02 14:00:00 America/Los_Angeles],
~Y[2017-01-03 10:00:00 America/Los_Angeles]
])
end

test "Every 6 hours on Mondays and Fridays" do
Expand All @@ -97,16 +97,16 @@ defmodule Cocktail.HourlyTest do
|> Enum.take(9)

assert equivalent_times?(times, [
~Y[2017-01-02 00:00:00 America/Los_Angeles],
~Y[2017-01-02 06:00:00 America/Los_Angeles],
~Y[2017-01-02 12:00:00 America/Los_Angeles],
~Y[2017-01-02 18:00:00 America/Los_Angeles],
~Y[2017-01-06 00:00:00 America/Los_Angeles],
~Y[2017-01-06 06:00:00 America/Los_Angeles],
~Y[2017-01-06 12:00:00 America/Los_Angeles],
~Y[2017-01-06 18:00:00 America/Los_Angeles],
~Y[2017-01-09 00:00:00 America/Los_Angeles]
])
~Y[2017-01-02 00:00:00 America/Los_Angeles],
~Y[2017-01-02 06:00:00 America/Los_Angeles],
~Y[2017-01-02 12:00:00 America/Los_Angeles],
~Y[2017-01-02 18:00:00 America/Los_Angeles],
~Y[2017-01-06 00:00:00 America/Los_Angeles],
~Y[2017-01-06 06:00:00 America/Los_Angeles],
~Y[2017-01-06 12:00:00 America/Los_Angeles],
~Y[2017-01-06 18:00:00 America/Los_Angeles],
~Y[2017-01-09 00:00:00 America/Los_Angeles]
])
end

test "Hourly on Mondays and Fridays on the 10th and 14th hours of the day" do
Expand All @@ -118,11 +118,11 @@ defmodule Cocktail.HourlyTest do
|> Enum.take(5)

assert equivalent_times?(times, [
~Y[2017-01-02 10:00:00 America/Los_Angeles],
~Y[2017-01-02 14:00:00 America/Los_Angeles],
~Y[2017-01-06 10:00:00 America/Los_Angeles],
~Y[2017-01-06 14:00:00 America/Los_Angeles],
~Y[2017-01-09 10:00:00 America/Los_Angeles]
])
~Y[2017-01-02 10:00:00 America/Los_Angeles],
~Y[2017-01-02 14:00:00 America/Los_Angeles],
~Y[2017-01-06 10:00:00 America/Los_Angeles],
~Y[2017-01-06 14:00:00 America/Los_Angeles],
~Y[2017-01-09 10:00:00 America/Los_Angeles]
])
end
end
Loading

0 comments on commit 8abc999

Please sign in to comment.