Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions lib/holidays/definitions/br.ex
Original file line number Diff line number Diff line change
Expand Up @@ -88,14 +88,14 @@ defmodule Holidays.Definitions.Br do

## Examples

iex> Holidays.Defenitions.Br.election_day(2016)
iex> Holidays.Definitions.Br.election_day(2016)
:none

iex> Holidays.Defenitions.Br.election_day(2017)
iex> Holidays.Definitions.Br.election_day(2017)
:none

iex> Holidays.Defenitions.Br.election_day(2018)
{:ok, {2018, 10, 7}
iex> Holidays.Definitions.Br.election_day(2018)
{2018, 10, 7}
"""
def election_day(year) when rem(year, 4) == 2,
do: DateMath.get_weekth_day(year, 10, :first, :sunday)
Expand Down
8 changes: 4 additions & 4 deletions lib/holidays/definitions/us.ex
Original file line number Diff line number Diff line change
Expand Up @@ -97,16 +97,16 @@ defmodule Holidays.Definitions.Us do

## Examples

iex> Holidays.Defenitions.Us.inauguration_day(2016)
iex> Holidays.Definitions.Us.inauguration_day(2016)
:none

iex> Holidays.Defenitions.Us.inauguration_day(2017)
iex> Holidays.Definitions.Us.inauguration_day(2017)
{2017, 1, 20}

iex> Holidays.Defenitions.Us.inauguration_day(2018)
iex> Holidays.Definitions.Us.inauguration_day(2018)
:none
"""
def inauguration_day(year) when rem(year, 4) == 1, do: {:ok, {year, 1, 20}}
def inauguration_day(year) when rem(year, 4) == 1, do: {year, 1, 20}
def inauguration_day(_year), do: :none

def day_after_thanksgiving(year) do
Expand Down
2 changes: 2 additions & 0 deletions test/holidays/definitions/br_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ defmodule Holidays.BrTest do
:ok
end

doctest Holidays.Definitions.Br

holiday_test("Confraternização Universal", {2018, 1, 1}, :br)
holiday_test("Tiradentes", {2018, 4, 21}, :br)
holiday_test("Dia do Trabalhador", {2018, 5, 1}, :br)
Expand Down
3 changes: 3 additions & 0 deletions test/holidays/definitions/us_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ defmodule Holidays.UsTest do
:ok
end

doctest Holidays.Definitions.Us

holiday_test("New Year's Day", {2008, 1, 1}, :us)
holiday_test("Martin Luther King, Jr. Day", {2008, 1, 21}, :us)
holiday_test("Presidents' Day", {2008, 2, 18}, :us)
Expand All @@ -24,4 +26,5 @@ defmodule Holidays.UsTest do
holiday_test("Christmas Day", {2008, 12, 25}, :us)
holiday_test("Easter Sunday", {2016, 3, 27}, :us)
holiday_test("Good Friday", {2016, 3, 25}, :us)
holiday_test("Inauguration Day", {2025, 1, 20}, :us_dc)
end
4 changes: 2 additions & 2 deletions test/test_helper.exs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ defmodule Holidays.TestHelper do

quote do
test unquote(test_name) do
assert Holidays.on(unquote(date), unquote(regions)) == [%{name: unquote(name)}]
assert Enum.member?(Holidays.on(unquote(date), unquote(regions)), %{name: unquote(name)})
end
end
end
Expand All @@ -14,7 +14,7 @@ defmodule Holidays.TestHelper do

quote do
test unquote(test_name) do
assert Holidays.on(unquote(date), [unquote(region)]) == [%{name: unquote(name)}]
assert Enum.member?(Holidays.on(unquote(date), [unquote(region)]), %{name: unquote(name)})
end
end
end
Expand Down