holidays 5.7.0 → 6.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitmodules +1 -1
- data/CHANGELOG.md +11 -0
- data/lib/generated_definitions/north_america.rb +1 -1
- data/lib/generated_definitions/tr.rb +1 -0
- data/lib/generated_definitions/us.rb +1 -1
- data/lib/holidays/definition/context/generator.rb +5 -36
- data/lib/holidays/definition/decorator/test.rb +37 -0
- data/lib/holidays/definition/entity/test.rb +11 -0
- data/lib/holidays/definition/generator/test.rb +51 -0
- data/lib/holidays/definition/parser/test.rb +86 -0
- data/lib/holidays/definition/validator/test.rb +71 -0
- data/lib/holidays/errors.rb +3 -0
- data/lib/holidays/factory/definition.rb +24 -0
- data/lib/holidays/version.rb +1 -1
- data/test/coverage_report.rb +1 -0
- data/test/data/test_custom_year_range_holiday_defs.yaml +7 -0
- data/test/data/test_multiple_custom_holiday_defs.yaml +7 -4
- data/test/data/test_single_custom_holiday_defs.yaml +7 -4
- data/test/data/test_single_custom_holiday_with_custom_procs.yaml +11 -7
- data/test/defs/test_defs_ar.rb +33 -19
- data/test/defs/test_defs_at.rb +14 -11
- data/test/defs/test_defs_au.rb +172 -141
- data/test/defs/test_defs_be_fr.rb +23 -14
- data/test/defs/test_defs_be_nl.rb +23 -14
- data/test/defs/test_defs_bg.rb +29 -17
- data/test/defs/test_defs_br.rb +33 -19
- data/test/defs/test_defs_ca.rb +175 -176
- data/test/defs/test_defs_ch.rb +29 -23
- data/test/defs/test_defs_cl.rb +49 -27
- data/test/defs/test_defs_cr.rb +17 -11
- data/test/defs/test_defs_cz.rb +25 -15
- data/test/defs/test_defs_de.rb +52 -61
- data/test/defs/test_defs_dk.rb +31 -19
- data/test/defs/test_defs_ecb_target.rb +14 -10
- data/test/defs/test_defs_ee.rb +28 -20
- data/test/defs/test_defs_el.rb +29 -17
- data/test/defs/test_defs_es.rb +114 -52
- data/test/defs/test_defs_europe.rb +1154 -715
- data/test/defs/test_defs_federal_reserve.rb +99 -57
- data/test/defs/test_defs_fedex.rb +19 -12
- data/test/defs/test_defs_fi.rb +47 -27
- data/test/defs/test_defs_fr.rb +29 -24
- data/test/defs/test_defs_gb.rb +90 -51
- data/test/defs/test_defs_ge.rb +40 -28
- data/test/defs/test_defs_hk.rb +47 -26
- data/test/defs/test_defs_hr.rb +32 -18
- data/test/defs/test_defs_hu.rb +26 -16
- data/test/defs/test_defs_ie.rb +41 -25
- data/test/defs/test_defs_is.rb +39 -22
- data/test/defs/test_defs_it.rb +23 -14
- data/test/defs/test_defs_jp.rb +112 -59
- data/test/defs/test_defs_kr.rb +25 -17
- data/test/defs/test_defs_li.rb +20 -20
- data/test/defs/test_defs_lt.rb +51 -30
- data/test/defs/test_defs_lu.rb +17 -12
- data/test/defs/test_defs_ma.rb +17 -11
- data/test/defs/test_defs_mt_en.rb +28 -19
- data/test/defs/test_defs_mt_mt.rb +28 -19
- data/test/defs/test_defs_mx.rb +33 -22
- data/test/defs/test_defs_my.rb +11 -8
- data/test/defs/test_defs_nerc.rb +17 -11
- data/test/defs/test_defs_nl.rb +21 -13
- data/test/defs/test_defs_no.rb +31 -18
- data/test/defs/test_defs_north_america.rb +507 -393
- data/test/defs/test_defs_nyse.rb +26 -15
- data/test/defs/test_defs_nz.rb +47 -28
- data/test/defs/test_defs_pe.rb +35 -20
- data/test/defs/test_defs_ph.rb +17 -11
- data/test/defs/test_defs_pl.rb +200 -119
- data/test/defs/test_defs_pt.rb +33 -24
- data/test/defs/test_defs_ro.rb +39 -24
- data/test/defs/test_defs_rs_cyrl.rb +33 -26
- data/test/defs/test_defs_rs_la.rb +33 -26
- data/test/defs/test_defs_ru.rb +22 -16
- data/test/defs/test_defs_scandinavia.rb +193 -116
- data/test/defs/test_defs_se.rb +47 -28
- data/test/defs/test_defs_sg.rb +13 -9
- data/test/defs/test_defs_si.rb +93 -24
- data/test/defs/test_defs_sk.rb +29 -17
- data/test/defs/test_defs_tn.rb +15 -10
- data/test/defs/test_defs_tr.rb +39 -30
- data/test/defs/test_defs_united_nations.rb +0 -1
- data/test/defs/test_defs_ups.rb +19 -12
- data/test/defs/test_defs_us.rb +333 -217
- data/test/defs/test_defs_ve.rb +23 -16
- data/test/defs/test_defs_vi.rb +10 -8
- data/test/defs/test_defs_za.rb +23 -14
- data/test/holidays/definition/context/test_generator.rb +40 -13
- data/test/holidays/definition/decorator/test_test.rb +123 -0
- data/test/holidays/definition/generator/test_test.rb +113 -0
- data/test/holidays/definition/parser/test_test.rb +142 -0
- data/test/holidays/definition/validator/test_region.rb +5 -0
- data/test/holidays/definition/validator/test_test.rb +60 -0
- metadata +15 -8
- data/test/holidays/factory/test_date_calculator.rb +0 -32
- data/test/holidays/factory/test_definition.rb +0 -62
- data/test/holidays/factory/test_finder.rb +0 -25
@@ -7,26 +7,35 @@ require File.expand_path(File.dirname(__FILE__)) + '/../test_helper'
|
|
7
7
|
class Mt_mtDefinitionTests < Test::Unit::TestCase # :nodoc:
|
8
8
|
|
9
9
|
def test_mt_mt
|
10
|
-
|
11
|
-
Date.civil(2017, 2, 10) => "Nawfraġju ta' San Pawl",
|
12
|
-
Date.civil(2017, 3, 19) => 'San Ġużepp',
|
13
|
-
Date.civil(2017, 3, 31) => 'Jum il-Ħelsien',
|
14
|
-
Date.civil(2017, 5, 1) => 'Jum il-Ħaddiem',
|
15
|
-
Date.civil(2017, 6, 7) => 'Sette Giugno',
|
16
|
-
Date.civil(2017, 6, 29) => 'L-Imnarja',
|
17
|
-
Date.civil(2017, 8, 15) => 'Santa Marija',
|
18
|
-
Date.civil(2017, 9, 8) => 'Jum il-Vitorja',
|
19
|
-
Date.civil(2017, 9, 21) => 'Jum l-Indipendenza',
|
20
|
-
Date.civil(2017, 12, 8) => 'Il-Kunċizzjoni',
|
21
|
-
Date.civil(2017, 12, 13) => 'Jum ir-Repubblika',
|
22
|
-
Date.civil(2017, 12, 25) => 'Il-Milied',
|
23
|
-
}.each do |date, name|
|
24
|
-
assert_equal name, (Holidays.on(date, :mt_mt)[0] || {})[:name]
|
25
|
-
end
|
10
|
+
assert_equal "L-Ewwel tas-Sena", (Holidays.on(Date.civil(2017, 1, 1), [:mt_mt])[0] || {})[:name]
|
26
11
|
|
27
|
-
|
28
|
-
|
29
|
-
|
12
|
+
assert_equal "Nawfraġju ta' San Pawl", (Holidays.on(Date.civil(2017, 2, 10), [:mt_mt])[0] || {})[:name]
|
13
|
+
|
14
|
+
assert_equal "San Ġużepp", (Holidays.on(Date.civil(2017, 3, 19), [:mt_mt])[0] || {})[:name]
|
15
|
+
|
16
|
+
assert_equal "Jum il-Ħelsien", (Holidays.on(Date.civil(2017, 3, 31), [:mt_mt])[0] || {})[:name]
|
17
|
+
|
18
|
+
assert_equal "Jum il-Ħaddiem", (Holidays.on(Date.civil(2017, 5, 1), [:mt_mt])[0] || {})[:name]
|
19
|
+
|
20
|
+
assert_equal "Sette Giugno", (Holidays.on(Date.civil(2017, 6, 7), [:mt_mt])[0] || {})[:name]
|
21
|
+
|
22
|
+
assert_equal "L-Imnarja", (Holidays.on(Date.civil(2017, 6, 29), [:mt_mt])[0] || {})[:name]
|
23
|
+
|
24
|
+
assert_equal "Santa Marija", (Holidays.on(Date.civil(2017, 8, 15), [:mt_mt])[0] || {})[:name]
|
25
|
+
|
26
|
+
assert_equal "Jum il-Vitorja", (Holidays.on(Date.civil(2017, 9, 8), [:mt_mt])[0] || {})[:name]
|
27
|
+
|
28
|
+
assert_equal "Jum l-Indipendenza", (Holidays.on(Date.civil(2017, 9, 21), [:mt_mt])[0] || {})[:name]
|
29
|
+
|
30
|
+
assert_equal "Il-Kunċizzjoni", (Holidays.on(Date.civil(2017, 12, 8), [:mt_mt])[0] || {})[:name]
|
31
|
+
|
32
|
+
assert_equal "Jum ir-Repubblika", (Holidays.on(Date.civil(2017, 12, 13), [:mt_mt])[0] || {})[:name]
|
33
|
+
|
34
|
+
assert_equal "Il-Milied", (Holidays.on(Date.civil(2017, 12, 25), [:mt_mt])[0] || {})[:name]
|
35
|
+
|
36
|
+
assert_equal "Il-Ġimgħa l-Kbira", (Holidays.on(Date.civil(2017, 4, 14), [:mt_mt])[0] || {})[:name]
|
37
|
+
assert_equal "Il-Ġimgħa l-Kbira", (Holidays.on(Date.civil(2018, 3, 30), [:mt_mt])[0] || {})[:name]
|
38
|
+
assert_equal "Il-Ġimgħa l-Kbira", (Holidays.on(Date.civil(2019, 4, 19), [:mt_mt])[0] || {})[:name]
|
30
39
|
|
31
40
|
end
|
32
41
|
end
|
data/test/defs/test_defs_mx.rb
CHANGED
@@ -7,30 +7,41 @@ require File.expand_path(File.dirname(__FILE__)) + '/../test_helper'
|
|
7
7
|
class MxDefinitionTests < Test::Unit::TestCase # :nodoc:
|
8
8
|
|
9
9
|
def test_mx
|
10
|
-
|
11
|
-
Date.civil(2007,2,5) => 'Día de la Constitución',
|
12
|
-
Date.civil(2007,5,1) => 'Día del Trabajo',
|
13
|
-
Date.civil(2007,5,5) => 'Cinco de Mayo',
|
14
|
-
Date.civil(2007,9,16) => 'Día de la Independencia',
|
15
|
-
Date.civil(2007,11,1) => 'Todos los Santos',
|
16
|
-
Date.civil(2007,11,2) => 'Los Fieles Difuntos',
|
17
|
-
Date.civil(2007,11,19) => 'Día de la Revolución',
|
18
|
-
Date.civil(2007,12,25) => 'Navidad'}.each do |date, name|
|
19
|
-
assert_equal name, (Holidays.on(date, :mx, :informal)[0] || {})[:name]
|
20
|
-
end
|
10
|
+
assert_equal "Año nuevo", (Holidays.on(Date.civil(2007, 1, 1), [:mx], [:informal])[0] || {})[:name]
|
21
11
|
|
12
|
+
assert_equal "Día de la Constitución", (Holidays.on(Date.civil(2007, 2, 5), [:mx], [:informal])[0] || {})[:name]
|
22
13
|
|
23
|
-
|
24
|
-
|
25
|
-
Date.civil(
|
26
|
-
|
27
|
-
Date.civil(
|
28
|
-
|
29
|
-
Date.civil(
|
30
|
-
|
31
|
-
Date.civil(
|
32
|
-
|
33
|
-
|
14
|
+
assert_equal "Día del Trabajo", (Holidays.on(Date.civil(2007, 5, 1), [:mx], [:informal])[0] || {})[:name]
|
15
|
+
|
16
|
+
assert_equal "Cinco de Mayo", (Holidays.on(Date.civil(2007, 5, 5), [:mx], [:informal])[0] || {})[:name]
|
17
|
+
|
18
|
+
assert_equal "Día de la Independencia", (Holidays.on(Date.civil(2007, 9, 16), [:mx], [:informal])[0] || {})[:name]
|
19
|
+
|
20
|
+
assert_equal "Todos los Santos", (Holidays.on(Date.civil(2007, 11, 1), [:mx], [:informal])[0] || {})[:name]
|
21
|
+
|
22
|
+
assert_equal "Los Fieles Difuntos", (Holidays.on(Date.civil(2007, 11, 2), [:mx], [:informal])[0] || {})[:name]
|
23
|
+
|
24
|
+
assert_equal "Día de la Revolución", (Holidays.on(Date.civil(2007, 11, 19), [:mx], [:informal])[0] || {})[:name]
|
25
|
+
|
26
|
+
assert_equal "Navidad", (Holidays.on(Date.civil(2007, 12, 25), [:mx], [:informal])[0] || {})[:name]
|
27
|
+
|
28
|
+
assert_equal "Groundhog Day", (Holidays.on(Date.civil(2013, 2, 2), [:us], [:informal])[0] || {})[:name]
|
29
|
+
|
30
|
+
assert_equal "Valentine's Day", (Holidays.on(Date.civil(2013, 2, 14), [:us], [:informal])[0] || {})[:name]
|
31
|
+
|
32
|
+
assert_equal "St. Patrick's Day", (Holidays.on(Date.civil(2013, 3, 17), [:us], [:informal])[0] || {})[:name]
|
33
|
+
|
34
|
+
assert_equal "April Fool's Day", (Holidays.on(Date.civil(2013, 4, 1), [:us], [:informal])[0] || {})[:name]
|
35
|
+
|
36
|
+
assert_equal "Earth Day", (Holidays.on(Date.civil(2013, 4, 22), [:us], [:informal])[0] || {})[:name]
|
37
|
+
|
38
|
+
assert_equal "Mother's Day", (Holidays.on(Date.civil(2013, 5, 12), [:us], [:informal])[0] || {})[:name]
|
39
|
+
|
40
|
+
assert_equal "Armed Forces Day", (Holidays.on(Date.civil(2013, 5, 18), [:us], [:informal])[0] || {})[:name]
|
41
|
+
|
42
|
+
assert_equal "Father's Day", (Holidays.on(Date.civil(2013, 6, 16), [:us], [:informal])[0] || {})[:name]
|
43
|
+
|
44
|
+
assert_equal "Halloween", (Holidays.on(Date.civil(2013, 10, 31), [:us], [:informal])[0] || {})[:name]
|
34
45
|
|
35
46
|
end
|
36
47
|
end
|
data/test/defs/test_defs_my.rb
CHANGED
@@ -7,14 +7,17 @@ require File.expand_path(File.dirname(__FILE__)) + '/../test_helper'
|
|
7
7
|
class MyDefinitionTests < Test::Unit::TestCase # :nodoc:
|
8
8
|
|
9
9
|
def test_my
|
10
|
-
|
11
|
-
|
12
|
-
Date.civil(2016,
|
13
|
-
|
14
|
-
Date.civil(2016,
|
15
|
-
|
16
|
-
|
17
|
-
|
10
|
+
assert_equal "New Year's Day", (Holidays.on(Date.civil(2016, 1, 1), [:my], [:informal])[0] || {})[:name]
|
11
|
+
|
12
|
+
assert_equal "Labour Day", (Holidays.on(Date.civil(2016, 5, 1), [:my], [:informal])[0] || {})[:name]
|
13
|
+
|
14
|
+
assert_equal "Agong's Birthday", (Holidays.on(Date.civil(2016, 6, 4), [:my], [:informal])[0] || {})[:name]
|
15
|
+
|
16
|
+
assert_equal "Independence Day", (Holidays.on(Date.civil(2016, 8, 31), [:my], [:informal])[0] || {})[:name]
|
17
|
+
|
18
|
+
assert_equal "Malaysia Day", (Holidays.on(Date.civil(2016, 9, 16), [:my], [:informal])[0] || {})[:name]
|
19
|
+
|
20
|
+
assert_equal "Christmas Day", (Holidays.on(Date.civil(2016, 12, 25), [:my], [:informal])[0] || {})[:name]
|
18
21
|
|
19
22
|
end
|
20
23
|
end
|
data/test/defs/test_defs_nerc.rb
CHANGED
@@ -7,17 +7,23 @@ require File.expand_path(File.dirname(__FILE__)) + '/../test_helper'
|
|
7
7
|
class NercDefinitionTests < Test::Unit::TestCase # :nodoc:
|
8
8
|
|
9
9
|
def test_nerc
|
10
|
-
|
11
|
-
|
12
|
-
Date.civil(
|
13
|
-
|
14
|
-
Date.civil(
|
15
|
-
|
16
|
-
Date.civil(2013,
|
17
|
-
|
18
|
-
Date.civil(
|
19
|
-
|
20
|
-
|
10
|
+
assert_equal "New Year's Day", (Holidays.on(Date.civil(2013, 1, 1), [:nerc], [:observed])[0] || {})[:name]
|
11
|
+
|
12
|
+
assert_equal "New Year's Day", (Holidays.on(Date.civil(2017, 1, 2), [:nerc], [:observed])[0] || {})[:name]
|
13
|
+
|
14
|
+
assert_equal "Memorial Day", (Holidays.on(Date.civil(2013, 5, 27), [:nerc], [:observed])[0] || {})[:name]
|
15
|
+
|
16
|
+
assert_equal "Independence Day", (Holidays.on(Date.civil(2013, 7, 4), [:nerc], [:observed])[0] || {})[:name]
|
17
|
+
|
18
|
+
assert_equal "Independence Day", (Holidays.on(Date.civil(2010, 7, 5), [:nerc], [:observed])[0] || {})[:name]
|
19
|
+
|
20
|
+
assert_equal "Labor Day", (Holidays.on(Date.civil(2013, 9, 2), [:nerc], [:observed])[0] || {})[:name]
|
21
|
+
|
22
|
+
assert_equal "Thanksgiving", (Holidays.on(Date.civil(2013, 11, 28), [:nerc], [:observed])[0] || {})[:name]
|
23
|
+
|
24
|
+
assert_equal "Christmas Day", (Holidays.on(Date.civil(2013, 12, 25), [:nerc], [:observed])[0] || {})[:name]
|
25
|
+
|
26
|
+
assert_equal "Christmas Day", (Holidays.on(Date.civil(2011, 12, 26), [:nerc], [:observed])[0] || {})[:name]
|
21
27
|
|
22
28
|
end
|
23
29
|
end
|
data/test/defs/test_defs_nl.rb
CHANGED
@@ -7,19 +7,27 @@ require File.expand_path(File.dirname(__FILE__)) + '/../test_helper'
|
|
7
7
|
class NlDefinitionTests < Test::Unit::TestCase # :nodoc:
|
8
8
|
|
9
9
|
def test_nl
|
10
|
-
|
11
|
-
|
12
|
-
Date.civil(2008,3,
|
13
|
-
|
14
|
-
Date.civil(2008,
|
15
|
-
|
16
|
-
Date.civil(2008,
|
17
|
-
|
18
|
-
Date.civil(2008,
|
19
|
-
|
20
|
-
Date.civil(2008,
|
21
|
-
|
22
|
-
|
10
|
+
assert_equal "Nieuwjaarsdag", (Holidays.on(Date.civil(2008, 1, 1), [:nl], [:informal])[0] || {})[:name]
|
11
|
+
|
12
|
+
assert_equal "Goede Vrijdag", (Holidays.on(Date.civil(2008, 3, 21), [:nl], [:informal])[0] || {})[:name]
|
13
|
+
|
14
|
+
assert_equal "Eerste Paasdag", (Holidays.on(Date.civil(2008, 3, 23), [:nl], [:informal])[0] || {})[:name]
|
15
|
+
|
16
|
+
assert_equal "Tweede Paasdag", (Holidays.on(Date.civil(2008, 3, 24), [:nl], [:informal])[0] || {})[:name]
|
17
|
+
|
18
|
+
assert_equal "Koningsdag", (Holidays.on(Date.civil(2008, 4, 27), [:nl], [:informal])[0] || {})[:name]
|
19
|
+
|
20
|
+
assert_equal "Hemelvaartsdag", (Holidays.on(Date.civil(2008, 5, 1), [:nl], [:informal])[0] || {})[:name]
|
21
|
+
|
22
|
+
assert_equal "Bevrijdingsdag", (Holidays.on(Date.civil(2008, 5, 5), [:nl], [:informal])[0] || {})[:name]
|
23
|
+
|
24
|
+
assert_equal "Eerste Pinksterdag", (Holidays.on(Date.civil(2008, 5, 11), [:nl], [:informal])[0] || {})[:name]
|
25
|
+
|
26
|
+
assert_equal "Tweede Pinksterdag", (Holidays.on(Date.civil(2008, 5, 12), [:nl], [:informal])[0] || {})[:name]
|
27
|
+
|
28
|
+
assert_equal "Eerste Kerstdag", (Holidays.on(Date.civil(2008, 12, 25), [:nl], [:informal])[0] || {})[:name]
|
29
|
+
|
30
|
+
assert_equal "Tweede Kerstdag", (Holidays.on(Date.civil(2008, 12, 26), [:nl], [:informal])[0] || {})[:name]
|
23
31
|
|
24
32
|
end
|
25
33
|
end
|
data/test/defs/test_defs_no.rb
CHANGED
@@ -7,24 +7,37 @@ require File.expand_path(File.dirname(__FILE__)) + '/../test_helper'
|
|
7
7
|
class NoDefinitionTests < Test::Unit::TestCase # :nodoc:
|
8
8
|
|
9
9
|
def test_no
|
10
|
-
|
11
|
-
|
12
|
-
Date.civil(2010,5,
|
13
|
-
|
14
|
-
Date.civil(2010,
|
15
|
-
|
16
|
-
Date.civil(2010,12,
|
17
|
-
|
18
|
-
Date.civil(2010,
|
19
|
-
|
20
|
-
Date.civil(2010,
|
21
|
-
|
22
|
-
Date.civil(2010,
|
23
|
-
|
24
|
-
Date.civil(2010,
|
25
|
-
|
26
|
-
|
27
|
-
|
10
|
+
assert_equal "Nyttårsdag", (Holidays.on(Date.civil(2010, 1, 1), [:no], [:informal])[0] || {})[:name]
|
11
|
+
|
12
|
+
assert_equal "1. mai", (Holidays.on(Date.civil(2010, 5, 1), [:no], [:informal])[0] || {})[:name]
|
13
|
+
|
14
|
+
assert_equal "17. mai", (Holidays.on(Date.civil(2010, 5, 17), [:no], [:informal])[0] || {})[:name]
|
15
|
+
|
16
|
+
assert_equal "Julaften", (Holidays.on(Date.civil(2010, 12, 24), [:no], [:informal])[0] || {})[:name]
|
17
|
+
|
18
|
+
assert_equal "1. juledag", (Holidays.on(Date.civil(2010, 12, 25), [:no], [:informal])[0] || {})[:name]
|
19
|
+
|
20
|
+
assert_equal "2. juledag", (Holidays.on(Date.civil(2010, 12, 26), [:no], [:informal])[0] || {})[:name]
|
21
|
+
|
22
|
+
assert_equal "Nyttårsaften", (Holidays.on(Date.civil(2010, 12, 31), [:no], [:informal])[0] || {})[:name]
|
23
|
+
|
24
|
+
assert_equal "Fastelavn", (Holidays.on(Date.civil(2010, 2, 14), [:no], [:informal])[0] || {})[:name]
|
25
|
+
|
26
|
+
assert_equal "Palmesøndag", (Holidays.on(Date.civil(2010, 3, 28), [:no], [:informal])[0] || {})[:name]
|
27
|
+
|
28
|
+
assert_equal "Skjærtorsdag", (Holidays.on(Date.civil(2010, 4, 1), [:no], [:informal])[0] || {})[:name]
|
29
|
+
|
30
|
+
assert_equal "Langfredag", (Holidays.on(Date.civil(2010, 4, 2), [:no], [:informal])[0] || {})[:name]
|
31
|
+
|
32
|
+
assert_equal "1. påskedag", (Holidays.on(Date.civil(2010, 4, 4), [:no], [:informal])[0] || {})[:name]
|
33
|
+
|
34
|
+
assert_equal "2. påskedag", (Holidays.on(Date.civil(2010, 4, 5), [:no], [:informal])[0] || {})[:name]
|
35
|
+
|
36
|
+
assert_equal "Kristi Himmelfartsdag", (Holidays.on(Date.civil(2010, 5, 13), [:no], [:informal])[0] || {})[:name]
|
37
|
+
|
38
|
+
assert_equal "1. pinsedag", (Holidays.on(Date.civil(2010, 5, 23), [:no], [:informal])[0] || {})[:name]
|
39
|
+
|
40
|
+
assert_equal "2. pinsedag", (Holidays.on(Date.civil(2010, 5, 24), [:no], [:informal])[0] || {})[:name]
|
28
41
|
|
29
42
|
end
|
30
43
|
end
|
@@ -7,466 +7,580 @@ require File.expand_path(File.dirname(__FILE__)) + '/../test_helper'
|
|
7
7
|
class North_americaDefinitionTests < Test::Unit::TestCase # :nodoc:
|
8
8
|
|
9
9
|
def test_north_america
|
10
|
-
|
11
|
-
Date.civil(2008,3,21) => 'Good Friday',
|
12
|
-
Date.civil(2013,3,31) => 'Easter Sunday',
|
13
|
-
Date.civil(2008,3,24) => 'Easter Monday',
|
14
|
-
Date.civil(2008,7,1) => 'Canada Day',
|
15
|
-
Date.civil(2008,9,1) => 'Labour Day',
|
16
|
-
Date.civil(2008,12,25) => 'Christmas Day'}.each do |date, name|
|
17
|
-
assert_equal name, (Holidays.on(date, :ca, :informal)[0] || {})[:name]
|
18
|
-
end
|
10
|
+
assert_equal "New Year's Day", (Holidays.on(Date.civil(2008, 1, 1), [:ca], [:informal])[0] || {})[:name]
|
19
11
|
|
20
|
-
|
21
|
-
[
|
22
|
-
Date.civil(1990,2,19),
|
23
|
-
Date.civil(2013,2,18),
|
24
|
-
Date.civil(2014,2,17),
|
25
|
-
Date.civil(2044,2,15),
|
26
|
-
].each do |date|
|
27
|
-
assert_equal 'Family Day', Holidays.on(date, :ca_ab)[0][:name]
|
28
|
-
end
|
12
|
+
assert_equal "Good Friday", (Holidays.on(Date.civil(2008, 3, 21), [:ca], [:informal])[0] || {})[:name]
|
29
13
|
|
30
|
-
|
31
|
-
[
|
32
|
-
Date.civil(1970,2,16),
|
33
|
-
Date.civil(1988,2,15),
|
34
|
-
Date.civil(1989,2,20),
|
35
|
-
].each do |date|
|
36
|
-
assert_equal [], Holidays.on(date, :ca_ab)
|
37
|
-
end
|
14
|
+
assert_equal "Easter Sunday", (Holidays.on(Date.civil(2013, 3, 31), [:ca], [:informal])[0] || {})[:name]
|
38
15
|
|
39
|
-
|
40
|
-
[
|
41
|
-
Date.civil(2007,2,19),
|
42
|
-
Date.civil(2013,2,18),
|
43
|
-
Date.civil(2014,2,17),
|
44
|
-
Date.civil(2044,2,15),
|
45
|
-
].each do |date|
|
46
|
-
assert_equal 'Family Day', Holidays.on(date, :ca_sk)[0][:name]
|
47
|
-
end
|
16
|
+
assert_equal "Easter Monday", (Holidays.on(Date.civil(2008, 3, 24), [:ca], [:informal])[0] || {})[:name]
|
48
17
|
|
49
|
-
|
50
|
-
[
|
51
|
-
Date.civil(1970,2,16),
|
52
|
-
Date.civil(1988,2,15),
|
53
|
-
Date.civil(1989,2,20),
|
54
|
-
Date.civil(2006,2,20),
|
55
|
-
].each do |date|
|
56
|
-
assert_equal [], Holidays.on(date, :ca_sk)
|
57
|
-
end
|
18
|
+
assert_equal "Canada Day", (Holidays.on(Date.civil(2008, 7, 1), [:ca], [:informal])[0] || {})[:name]
|
58
19
|
|
59
|
-
|
60
|
-
[
|
61
|
-
Date.civil(2008,2,18),
|
62
|
-
Date.civil(2013,2,18),
|
63
|
-
Date.civil(2014,2,17),
|
64
|
-
Date.civil(2044,2,15),
|
65
|
-
].each do |date|
|
66
|
-
assert_equal 'Family Day', Holidays.on(date, :ca_on)[0][:name]
|
67
|
-
end
|
20
|
+
assert_equal "Labour Day", (Holidays.on(Date.civil(2008, 9, 1), [:ca], [:informal])[0] || {})[:name]
|
68
21
|
|
69
|
-
|
70
|
-
[
|
71
|
-
Date.civil(1970,2,16),
|
72
|
-
Date.civil(1988,2,15),
|
73
|
-
Date.civil(1989,2,20),
|
74
|
-
Date.civil(2006,2,20),
|
75
|
-
Date.civil(2007,2,19),
|
76
|
-
].each do |date|
|
77
|
-
assert_equal [], Holidays.on(date, :ca_on)
|
78
|
-
end
|
22
|
+
assert_equal "Christmas Day", (Holidays.on(Date.civil(2008, 12, 25), [:ca], [:informal])[0] || {})[:name]
|
79
23
|
|
80
|
-
|
81
|
-
[
|
82
|
-
Date.civil(2013,2,11),
|
83
|
-
Date.civil(2014,2,10),
|
84
|
-
Date.civil(2044,2,8),
|
85
|
-
].each do |date|
|
86
|
-
assert_equal 'Family Day', Holidays.on(date, :ca_bc)[0][:name]
|
87
|
-
end
|
24
|
+
assert_equal "Family Day", (Holidays.on(Date.civil(1990, 2, 19), [:ca_ab])[0] || {})[:name]
|
88
25
|
|
89
|
-
|
90
|
-
[
|
91
|
-
Date.civil(2000,2,14),
|
92
|
-
Date.civil(2011,2,14),
|
93
|
-
Date.civil(2012,2,13),
|
94
|
-
].each do |date|
|
95
|
-
assert_equal [], Holidays.on(date, :ca_bc)
|
96
|
-
end
|
26
|
+
assert_equal "Family Day", (Holidays.on(Date.civil(2013, 2, 18), [:ca_ab])[0] || {})[:name]
|
97
27
|
|
98
|
-
|
99
|
-
[
|
100
|
-
Date.civil(2015,2,16),
|
101
|
-
Date.civil(2016,2,15),
|
102
|
-
Date.civil(2017,2,20),
|
103
|
-
Date.civil(2044,2,15),
|
104
|
-
].each do |date|
|
105
|
-
assert_equal 'Nova Scotia Heritage Day', Holidays.on(date, :ca_ns)[0][:name]
|
106
|
-
end
|
28
|
+
assert_equal "Family Day", (Holidays.on(Date.civil(2014, 2, 17), [:ca_ab])[0] || {})[:name]
|
107
29
|
|
108
|
-
|
109
|
-
[
|
110
|
-
Date.civil(2000,2,21),
|
111
|
-
Date.civil(2012,2,20),
|
112
|
-
Date.civil(2013,2,18),
|
113
|
-
Date.civil(2014,2,17),
|
114
|
-
].each do |date|
|
115
|
-
assert_equal [], Holidays.on(date, :ca_ns)
|
116
|
-
end
|
30
|
+
assert_equal "Family Day", (Holidays.on(Date.civil(2044, 2, 15), [:ca_ab])[0] || {})[:name]
|
117
31
|
|
118
|
-
|
119
|
-
[ Date.civil(2013,2,18), Date.civil(2014,2,17) ].each do |date|
|
120
|
-
assert_equal 'Islander Day', Holidays.on(date, :ca_pe)[0][:name]
|
121
|
-
end
|
32
|
+
assert_nil (Holidays.on(Date.civil(1970, 2, 16), [:ca_ab])[0] || {})[:name]
|
122
33
|
|
34
|
+
assert_nil (Holidays.on(Date.civil(1988, 2, 15), [:ca_ab])[0] || {})[:name]
|
123
35
|
|
124
|
-
|
125
|
-
[:ca_ab, :ca_bc, :ca_mb, :ca_nt, :ca_nu, :ca_on, :ca_sk, :ca_yt].each do |r|
|
126
|
-
[
|
127
|
-
Date.civil(2004,5,24), Date.civil(2005,5,23), Date.civil(2006,5,22),
|
128
|
-
Date.civil(2007,5,21), Date.civil(2008,5,19)
|
129
|
-
].each do |date|
|
130
|
-
assert_equal 'Victoria Day', Holidays.on(date, r)[0][:name]
|
131
|
-
end
|
132
|
-
end
|
36
|
+
assert_nil (Holidays.on(Date.civil(1989, 2, 20), [:ca_ab])[0] || {})[:name]
|
133
37
|
|
134
|
-
|
135
|
-
[Date.civil(2013,8,5), Date.civil(2014,8,4), Date.civil(2015,8,3)].each do |date|
|
136
|
-
{ :ca_bc => 'B.C. Day',
|
137
|
-
:ca_sk => 'Saskatchewan Day',
|
138
|
-
:ca_ab => 'Heritage Day',
|
139
|
-
:ca_ns => 'Natal Day',
|
140
|
-
:ca_nt => 'Civic Holiday',
|
141
|
-
:ca_nu => 'Civic Holiday',
|
142
|
-
:ca_pe => 'Civic Holiday',
|
143
|
-
:ca_nb => 'New Brunswick Day'
|
144
|
-
}.each do |region, name|
|
145
|
-
assert_equal name, Holidays.on(date, region)[0][:name]
|
146
|
-
end
|
147
|
-
end
|
38
|
+
assert_equal "Family Day", (Holidays.on(Date.civil(2007, 2, 19), [:ca_sk])[0] || {})[:name]
|
148
39
|
|
149
|
-
|
150
|
-
[Date.civil(2013,8,5), Date.civil(2014,8,4), Date.civil(2015,8,3)].each do |date|
|
151
|
-
assert_equal 'Civic Holiday', Holidays.on(date, :ca_on, :informal)[0][:name]
|
152
|
-
end
|
40
|
+
assert_equal "Family Day", (Holidays.on(Date.civil(2013, 2, 18), [:ca_sk])[0] || {})[:name]
|
153
41
|
|
154
|
-
|
155
|
-
# except (Nova Scotia, Manitoba, Ontario, and Quebec)
|
156
|
-
[
|
157
|
-
:ca_ab,
|
158
|
-
:ca_sk,
|
159
|
-
:ca_bc,
|
160
|
-
:ca_pe,
|
161
|
-
:ca_nl,
|
162
|
-
:ca_nt,
|
163
|
-
:ca_nu,
|
164
|
-
:ca_nb,
|
165
|
-
:ca_yt
|
166
|
-
].each do |province|
|
167
|
-
# Remembrance Day observed
|
168
|
-
[Date.civil(2010, 11, 11), Date.civil(2012, 11, 12), Date.civil(2017, 11, 13)].each do |date|
|
169
|
-
assert_equal 'Remembrance Day', Holidays.on(date, province, :observed)[0][:name]
|
170
|
-
end
|
42
|
+
assert_equal "Family Day", (Holidays.on(Date.civil(2014, 2, 17), [:ca_sk])[0] || {})[:name]
|
171
43
|
|
172
|
-
|
173
|
-
assert_equal "Remembrance Day", Holidays.on(Date.civil(2016,11,11), province)[0][:name]
|
174
|
-
end
|
44
|
+
assert_equal "Family Day", (Holidays.on(Date.civil(2044, 2, 15), [:ca_sk])[0] || {})[:name]
|
175
45
|
|
176
|
-
|
177
|
-
[Date.civil(2011, 1, 3), Date.civil(2012, 1, 2), Date.civil(2016, 1, 1)].each do |date|
|
178
|
-
assert_equal 'New Year\'s Day', Holidays.on(date, :ca, :observed)[0][:name]
|
179
|
-
end
|
46
|
+
assert_nil (Holidays.on(Date.civil(1970, 2, 16), [:ca_sk])[0] || {})[:name]
|
180
47
|
|
181
|
-
|
182
|
-
[Date.civil(2011, 7, 1), Date.civil(2012, 7, 2), Date.civil(2017, 7, 3)].each do |date|
|
183
|
-
assert_equal 'Canada Day', Holidays.on(date, :ca, :observed)[0][:name]
|
184
|
-
end
|
48
|
+
assert_nil (Holidays.on(Date.civil(1988, 2, 15), [:ca_sk])[0] || {})[:name]
|
185
49
|
|
186
|
-
|
187
|
-
[Date.civil(2010, 12, 27), Date.civil(2012, 12, 25), Date.civil(2016, 12, 26)].each do |date|
|
188
|
-
assert_equal 'Christmas Day', Holidays.on(date, :ca, :observed)[0][:name]
|
189
|
-
end
|
50
|
+
assert_nil (Holidays.on(Date.civil(1989, 2, 20), [:ca_sk])[0] || {})[:name]
|
190
51
|
|
191
|
-
|
192
|
-
[Date.civil(2010, 12, 28), Date.civil(2012, 12, 26), Date.civil(2016, 12, 27),
|
193
|
-
Date.civil(2015, 12, 28)].each do |date|
|
194
|
-
assert_equal 'Boxing Day', Holidays.on(date, :ca_on, :observed)[0][:name]
|
195
|
-
end
|
52
|
+
assert_nil (Holidays.on(Date.civil(2006, 2, 20), [:ca_sk])[0] || {})[:name]
|
196
53
|
|
54
|
+
assert_equal "Family Day", (Holidays.on(Date.civil(2008, 2, 18), [:ca_on])[0] || {})[:name]
|
197
55
|
|
198
|
-
|
199
|
-
Date.civil(2007,2,5) => 'Día de la Constitución',
|
200
|
-
Date.civil(2007,5,1) => 'Día del Trabajo',
|
201
|
-
Date.civil(2007,5,5) => 'Cinco de Mayo',
|
202
|
-
Date.civil(2007,9,16) => 'Día de la Independencia',
|
203
|
-
Date.civil(2007,11,1) => 'Todos los Santos',
|
204
|
-
Date.civil(2007,11,2) => 'Los Fieles Difuntos',
|
205
|
-
Date.civil(2007,11,19) => 'Día de la Revolución',
|
206
|
-
Date.civil(2007,12,25) => 'Navidad'}.each do |date, name|
|
207
|
-
assert_equal name, (Holidays.on(date, :mx, :informal)[0] || {})[:name]
|
208
|
-
end
|
56
|
+
assert_equal "Family Day", (Holidays.on(Date.civil(2013, 2, 18), [:ca_on])[0] || {})[:name]
|
209
57
|
|
58
|
+
assert_equal "Family Day", (Holidays.on(Date.civil(2014, 2, 17), [:ca_on])[0] || {})[:name]
|
210
59
|
|
211
|
-
|
212
|
-
assert_equal [], Holidays.on(date, [:us])
|
213
|
-
assert_equal 'Shrove Tuesday', Holidays.on(date, [:us_fl])[0][:name]
|
214
|
-
assert_equal 'Mardi Gras Day', Holidays.on(date, [:us_la])[0][:name]
|
215
|
-
end
|
216
|
-
states_good_friday = %i{us_ct us_de us_gu us_hi us_in us_ky us_la us_nj us_nc us_nd us_pr us_tn}
|
217
|
-
[Date.civil(2017, 4, 14), Date.civil(2018, 3, 30), Date.civil(2019, 4, 19)].each do |date|
|
218
|
-
assert_equal [], Holidays.on(date, [:us])
|
219
|
-
assert_equal 'Good Friday', Holidays.on(date, :us, :informal)[0][:name]
|
220
|
-
assert_equal 'Good Friday', Holidays.on(date, states_good_friday)[0][:name]
|
221
|
-
end
|
222
|
-
[Date.civil(2017, 4, 16), Date.civil(2018, 4, 1), Date.civil(2019, 4, 21)].each do |date|
|
223
|
-
assert_equal [], Holidays.on(date, [:us])
|
224
|
-
assert_equal 'Easter Sunday', Holidays.on(date, :us, :informal)[0][:name]
|
225
|
-
end
|
60
|
+
assert_equal "Family Day", (Holidays.on(Date.civil(2044, 2, 15), [:ca_on])[0] || {})[:name]
|
226
61
|
|
227
|
-
|
228
|
-
assert_equal "New Year's Day", Holidays.on(Date.civil(2017, 1, 2), :observed, [:us])[0][:name]
|
62
|
+
assert_nil (Holidays.on(Date.civil(1970, 2, 16), [:ca_on])[0] || {})[:name]
|
229
63
|
|
230
|
-
|
231
|
-
assert_equal 'Martin Luther King, Jr. Day', Holidays.on(date, [:us])[0][:name]
|
232
|
-
end
|
233
|
-
[Date.civil(2016, 1, 18), Date.civil(2017, 1, 16), Date.civil(2018, 1, 15)].each do |date|
|
234
|
-
assert_equal 'Martin Luther King, Jr. Day', Holidays.on(date, [:us])[0][:name]
|
235
|
-
assert_equal "Martin Luther King's and Robert E. Lee's Birthdays", Holidays.on(date, [:us_ms])[0][:name]
|
236
|
-
end
|
237
|
-
[Date.civil(2016, 1, 18), Date.civil(2017, 1, 16), Date.civil(2018, 1, 15)].each do |date|
|
238
|
-
assert_equal 'Martin Luther King, Jr. Day', Holidays.on(date, [:us])[0][:name]
|
239
|
-
assert_equal 'Idaho Human Rights Day', Holidays.on(date, [:us_id])[0][:name]
|
240
|
-
end
|
241
|
-
[Date.civil(2016, 1, 18), Date.civil(2017, 1, 16), Date.civil(2018, 1, 15)].each do |date|
|
242
|
-
assert_equal 'Martin Luther King, Jr. Day', Holidays.on(date, [:us])[0][:name]
|
243
|
-
assert_equal 'Civil Rights Day', Holidays.on(date, [:us_ar])[0][:name]
|
244
|
-
end
|
64
|
+
assert_nil (Holidays.on(Date.civil(1988, 2, 15), [:ca_on])[0] || {})[:name]
|
245
65
|
|
246
|
-
|
247
|
-
[Date.civil(2017, 1, 20), Date.civil(2021, 1, 20)].each do |date|
|
248
|
-
assert_equal [], Holidays.on(date, [:us])
|
249
|
-
assert_equal 'Inauguration Day', Holidays.on(date, states_inauguration)[0][:name]
|
250
|
-
end
|
251
|
-
assert_equal 'Inauguration Day', Holidays.on(Date.civil(2025, 1, 20), states_inauguration)[1][:name]
|
66
|
+
assert_nil (Holidays.on(Date.civil(1989, 2, 20), [:ca_on])[0] || {})[:name]
|
252
67
|
|
253
|
-
|
254
|
-
assert_equal [], Holidays.on(date, [:us])
|
255
|
-
assert_equal 'Lee-Jackson Day', Holidays.on(date, [:us_va])[0][:name]
|
256
|
-
end
|
68
|
+
assert_nil (Holidays.on(Date.civil(2006, 2, 20), [:ca_on])[0] || {})[:name]
|
257
69
|
|
258
|
-
|
70
|
+
assert_nil (Holidays.on(Date.civil(2007, 2, 19), [:ca_on])[0] || {})[:name]
|
259
71
|
|
260
|
-
|
261
|
-
assert_equal "Presidents' Day", Holidays.on(date, [:us])[0][:name]
|
262
|
-
end
|
263
|
-
[Date.civil(2017, 3, 6), Date.civil(2018, 3, 5), Date.civil(2019, 3, 4)].each do |date|
|
264
|
-
assert_equal [], Holidays.on(date, [:us])
|
265
|
-
assert_equal 'Casimir Pulaski Day', Holidays.on(date, [:us_il])[0][:name]
|
266
|
-
end
|
267
|
-
[Date.civil(2017, 3, 7), Date.civil(2018, 3, 6), Date.civil(2019, 3, 5)].each do |date|
|
268
|
-
assert_equal [], Holidays.on(date, [:us])
|
269
|
-
assert_equal 'Town Meeting Day', Holidays.on(date, [:us_vt])[0][:name]
|
270
|
-
end
|
72
|
+
assert_equal "Family Day", (Holidays.on(Date.civil(2013, 2, 11), [:ca_bc])[0] || {})[:name]
|
271
73
|
|
272
|
-
assert_equal
|
74
|
+
assert_equal "Family Day", (Holidays.on(Date.civil(2014, 2, 10), [:ca_bc])[0] || {})[:name]
|
273
75
|
|
274
|
-
|
275
|
-
assert_equal [], Holidays.on(date, [:us])
|
276
|
-
assert_equal 'Prince Jonah Kuhio Kalanianaole Day', Holidays.on(date, [:us_hi], :observed)[0][:name]
|
277
|
-
end
|
278
|
-
assert_equal [], Holidays.on(Date.civil(2017, 3, 26), [:us])
|
279
|
-
assert_equal 'Prince Jonah Kuhio Kalanianaole Day', Holidays.on(Date.civil(2017, 3, 26), [:us_hi])[0][:name]
|
76
|
+
assert_equal "Family Day", (Holidays.on(Date.civil(2044, 2, 8), [:ca_bc])[0] || {})[:name]
|
280
77
|
|
281
|
-
|
282
|
-
assert_equal [], Holidays.on(date, [:us])
|
283
|
-
assert_equal "Seward's Day", Holidays.on(date, [:us_ak])[0][:name]
|
284
|
-
end
|
78
|
+
assert_nil (Holidays.on(Date.civil(2000, 2, 14), [:ca_bc])[0] || {})[:name]
|
285
79
|
|
286
|
-
|
80
|
+
assert_nil (Holidays.on(Date.civil(2011, 2, 14), [:ca_bc])[0] || {})[:name]
|
287
81
|
|
288
|
-
|
289
|
-
assert_equal 'Emancipation Day', Holidays.on(date, [:us_dc, :us_ca], :observed)[0][:name]
|
290
|
-
end
|
291
|
-
assert_equal 'Emancipation Day', Holidays.on(Date.civil(2017, 4, 16), [:us_dc, :us_ca])[0][:name]
|
82
|
+
assert_nil (Holidays.on(Date.civil(2012, 2, 13), [:ca_bc])[0] || {})[:name]
|
292
83
|
|
293
|
-
|
294
|
-
assert_equal [], Holidays.on(date, [:us])
|
295
|
-
assert_equal "Patriots' Day", Holidays.on(date, [:us_me, :us_ma])[0][:name]
|
296
|
-
end
|
84
|
+
assert_equal "Nova Scotia Heritage Day", (Holidays.on(Date.civil(2015, 2, 16), [:ca_ns])[0] || {})[:name]
|
297
85
|
|
298
|
-
assert_equal
|
86
|
+
assert_equal "Nova Scotia Heritage Day", (Holidays.on(Date.civil(2016, 2, 15), [:ca_ns])[0] || {})[:name]
|
299
87
|
|
300
|
-
|
301
|
-
assert_equal [], Holidays.on(date, [:us])
|
302
|
-
assert_equal 'Confederate Memorial Day', Holidays.on(date, [:us_al, :us_ms])[0][:name]
|
303
|
-
end
|
304
|
-
[Date.civil(2015, 4, 27), Date.civil(2020, 4, 27), Date.civil(2026, 4, 27)].each do |date|
|
305
|
-
assert_equal [], Holidays.on(Date.civil(2020, 4, 27), [:us])
|
306
|
-
assert_equal 'Confederate Memorial Day', Holidays.on(Date.civil(2020, 4, 27), [:us_fl], :observed)[0][:name]
|
307
|
-
end
|
308
|
-
assert_equal [], Holidays.on(Date.civil(2017, 4, 26), [:us])
|
309
|
-
assert_equal 'Confederate Memorial Day', Holidays.on(Date.civil(2017, 4, 26), [:us_fl])[0][:name]
|
88
|
+
assert_equal "Nova Scotia Heritage Day", (Holidays.on(Date.civil(2017, 2, 20), [:ca_ns])[0] || {})[:name]
|
310
89
|
|
311
|
-
|
312
|
-
assert_equal [], Holidays.on(Date.civil(2015, 4, 20), [:us])
|
313
|
-
assert_equal 'State Holiday', Holidays.on(date, [:us_ga])[0][:name]
|
314
|
-
end
|
90
|
+
assert_equal "Nova Scotia Heritage Day", (Holidays.on(Date.civil(2044, 2, 15), [:ca_ns])[0] || {})[:name]
|
315
91
|
|
316
|
-
|
317
|
-
assert_equal 'Truman Day', Holidays.on(Date.civil(2017, 5, 8), [:us_mo])[0][:name]
|
318
|
-
assert_equal 'Confederate Memorial Day', Holidays.on(Date.civil(2017, 5, 10), [:us_sc])[0][:name]
|
92
|
+
assert_nil (Holidays.on(Date.civil(2000, 2, 21), [:ca_ns])[0] || {})[:name]
|
319
93
|
|
320
|
-
|
321
|
-
assert_equal 'Memorial Day', Holidays.on(date, [:us])[0][:name]
|
322
|
-
end
|
94
|
+
assert_nil (Holidays.on(Date.civil(2012, 2, 20), [:ca_ns])[0] || {})[:name]
|
323
95
|
|
324
|
-
|
325
|
-
assert_equal [], Holidays.on(date, [:us])
|
326
|
-
assert_equal "Jefferson Davis' Birthday", Holidays.on(date, [:us_al])[0][:name]
|
327
|
-
end
|
328
|
-
assert_equal 'Birthday of Jefferson Davis', Holidays.on(Date.civil(2017, 6, 3), [:us_fl])[0][:name]
|
96
|
+
assert_nil (Holidays.on(Date.civil(2013, 2, 18), [:ca_ns])[0] || {})[:name]
|
329
97
|
|
330
|
-
|
331
|
-
assert_equal [], Holidays.on(date, [:us])
|
332
|
-
assert_equal 'King Kamehameha I Day', Holidays.on(date, [:us_hi], :observed)[0][:name]
|
333
|
-
end
|
334
|
-
assert_equal [], Holidays.on(Date.civil(2017, 6, 11), [:us])
|
335
|
-
assert_equal 'King Kamehameha I Day', Holidays.on(Date.civil(2017, 6, 11), [:us_hi])[0][:name]
|
98
|
+
assert_nil (Holidays.on(Date.civil(2014, 2, 17), [:ca_ns])[0] || {})[:name]
|
336
99
|
|
337
|
-
assert_equal
|
100
|
+
assert_equal "Islander Day", (Holidays.on(Date.civil(2013, 2, 18), [:ca_pe])[0] || {})[:name]
|
338
101
|
|
339
|
-
|
340
|
-
assert_equal [], Holidays.on(date, [:us])
|
341
|
-
assert_equal 'West Virginia Day', Holidays.on(date, [:us_wv], :observed)[0][:name]
|
342
|
-
end
|
343
|
-
assert_equal [], Holidays.on(Date.civil(2017, 6, 20), [:us])
|
344
|
-
assert_equal 'West Virginia Day', Holidays.on(Date.civil(2017, 6, 20), [:us_wv])[0][:name]
|
102
|
+
assert_equal "Islander Day", (Holidays.on(Date.civil(2014, 2, 17), [:ca_pe])[0] || {})[:name]
|
345
103
|
|
346
|
-
assert_equal
|
104
|
+
assert_equal "Victoria Day", (Holidays.on(Date.civil(2004, 5, 24), [:ca_ab, :ca_bc, :ca_mb, :ca_nt, :ca_nu, :ca_on, :ca_sk, :ca_yt])[0] || {})[:name]
|
105
|
+
assert_equal "Victoria Day", (Holidays.on(Date.civil(2005, 5, 23), [:ca_ab, :ca_bc, :ca_mb, :ca_nt, :ca_nu, :ca_on, :ca_sk, :ca_yt])[0] || {})[:name]
|
106
|
+
assert_equal "Victoria Day", (Holidays.on(Date.civil(2006, 5, 22), [:ca_ab, :ca_bc, :ca_mb, :ca_nt, :ca_nu, :ca_on, :ca_sk, :ca_yt])[0] || {})[:name]
|
107
|
+
assert_equal "Victoria Day", (Holidays.on(Date.civil(2007, 5, 21), [:ca_ab, :ca_bc, :ca_mb, :ca_nt, :ca_nu, :ca_on, :ca_sk, :ca_yt])[0] || {})[:name]
|
108
|
+
assert_equal "Victoria Day", (Holidays.on(Date.civil(2008, 5, 19), [:ca_ab, :ca_bc, :ca_mb, :ca_nt, :ca_nu, :ca_on, :ca_sk, :ca_yt])[0] || {})[:name]
|
347
109
|
|
348
|
-
|
349
|
-
assert_equal 'Independence Day', Holidays.on(date, [:us])[0][:name]
|
350
|
-
assert_equal 'Independence Day', Holidays.on(date, [:us_va])[0][:name]
|
351
|
-
end
|
352
|
-
[Date.civil(2020, 7, 3), Date.civil(2021, 7, 5), Date.civil(2026, 7, 3)].each do |date|
|
353
|
-
assert_equal [], Holidays.on(date, [:us])
|
354
|
-
assert_equal 'Independence Day (Holiday)', Holidays.on(date, [:us_va])[0][:name]
|
355
|
-
end
|
110
|
+
assert_equal "B.C. Day", (Holidays.on(Date.civil(2013, 8, 5), [:ca_bc])[0] || {})[:name]
|
356
111
|
|
357
|
-
assert_equal
|
112
|
+
assert_equal "Saskatchewan Day", (Holidays.on(Date.civil(2013, 8, 5), [:ca_sk])[0] || {})[:name]
|
358
113
|
|
359
|
-
|
360
|
-
assert_equal [], Holidays.on(date, [:us])
|
361
|
-
assert_equal 'Victory Day', Holidays.on(date, [:us_ri])[0][:name]
|
362
|
-
end
|
114
|
+
assert_equal "Heritage Day", (Holidays.on(Date.civil(2013, 8, 5), [:ca_ab])[0] || {})[:name]
|
363
115
|
|
364
|
-
|
365
|
-
assert_equal [], Holidays.on(date, [:us])
|
366
|
-
assert_equal 'Bennington Battle Day', Holidays.on(date, [:us_vt], :observed)[0][:name]
|
367
|
-
end
|
368
|
-
assert_equal [], Holidays.on(Date.civil(2017, 8, 16), [:us])
|
369
|
-
assert_equal 'Bennington Battle Day', Holidays.on(Date.civil(2017, 8, 16), [:us_vt])[0][:name]
|
116
|
+
assert_equal "Natal Day", (Holidays.on(Date.civil(2013, 8, 5), [:ca_ns])[0] || {})[:name]
|
370
117
|
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
end
|
118
|
+
assert_equal "Civic Holiday", (Holidays.on(Date.civil(2013, 8, 5), [:ca_on], [:informal])[0] || {})[:name]
|
119
|
+
assert_equal "Civic Holiday", (Holidays.on(Date.civil(2014, 8, 4), [:ca_on], [:informal])[0] || {})[:name]
|
120
|
+
assert_equal "Civic Holiday", (Holidays.on(Date.civil(2015, 8, 3), [:ca_on], [:informal])[0] || {})[:name]
|
375
121
|
|
376
|
-
assert_equal
|
122
|
+
assert_equal "Civic Holiday", (Holidays.on(Date.civil(2013, 8, 5), [:ca_nt])[0] || {})[:name]
|
377
123
|
|
378
|
-
|
379
|
-
assert_equal 'Labor Day', Holidays.on(date, [:us])[0][:name]
|
380
|
-
end
|
381
|
-
[Date.civil(2017, 9, 21), Date.civil(2018, 9, 10), Date.civil(2019, 9, 30)].each do |date|
|
382
|
-
assert_equal [], Holidays.on(date, [:us])
|
383
|
-
assert_equal 'Rosh Hashanah', Holidays.on(date, [:us_tx])[0][:name]
|
384
|
-
end
|
385
|
-
[Date.civil(2017, 9, 30), Date.civil(2018, 9, 19), Date.civil(2019, 10, 9)].each do |date|
|
386
|
-
assert_equal [], Holidays.on(date, [:us])
|
387
|
-
assert_equal 'Yom Kippur', Holidays.on(date, [:us_tx])[0][:name]
|
388
|
-
end
|
124
|
+
assert_equal "Civic Holiday", (Holidays.on(Date.civil(2013, 8, 5), [:ca_nu])[0] || {})[:name]
|
389
125
|
|
390
|
-
|
391
|
-
%i{us_al us_az us_co us_ct us_dc us_ga us_id us_il us_in us_ma us_md us_me us_mo us_mt us_ne
|
392
|
-
us_nj us_nm us_ny us_oh us_pa us_ri us_ut us_va us_wv}
|
393
|
-
states_columbus_day_informal =
|
394
|
-
%i{us_ak us_ar us_ca us_de us_fl us_hi us_mi us_mn us_nd us_nv us_or us_sd us_tx us_vt us_wa us_wi us_wy}
|
395
|
-
|
396
|
-
[Date.civil(2017, 10, 9), Date.civil(2018, 10, 8), Date.civil(2019, 10, 14)].each do |date|
|
397
|
-
assert_equal [], Holidays.on(date, [:us])
|
398
|
-
assert_equal [], Holidays.on(date, states_columbus_day_informal)
|
399
|
-
assert_equal 'Columbus Day', Holidays.on(date, states_columbus_day_formal)[0][:name]
|
400
|
-
assert_equal 'Columbus Day', Holidays.on(date, states_columbus_day_informal, :informal)[0][:name]
|
401
|
-
end
|
126
|
+
assert_equal "Civic Holiday", (Holidays.on(Date.civil(2013, 8, 5), [:ca_pe])[0] || {})[:name]
|
402
127
|
|
403
|
-
assert_equal
|
128
|
+
assert_equal "New Brunswick Day", (Holidays.on(Date.civil(2013, 8, 5), [:ca_nb])[0] || {})[:name]
|
404
129
|
|
405
|
-
|
406
|
-
assert_equal [], Holidays.on(date, [:us])
|
407
|
-
assert_equal 'Nevada Day', Holidays.on(date, :us_nv)[0][:name]
|
408
|
-
end
|
130
|
+
assert_equal "B.C. Day", (Holidays.on(Date.civil(2014, 8, 4), [:ca_bc])[0] || {})[:name]
|
409
131
|
|
410
|
-
|
411
|
-
[Date.civil(2017, 11, 7), Date.civil(2018, 11, 6), Date.civil(2021, 11, 2)].each do |date|
|
412
|
-
assert_equal [], Holidays.on(date, [:us])
|
413
|
-
assert_equal 'Election Day', Holidays.on(date, states_election_day)[0][:name]
|
414
|
-
end
|
132
|
+
assert_equal "Saskatchewan Day", (Holidays.on(Date.civil(2014, 8, 4), [:ca_sk])[0] || {})[:name]
|
415
133
|
|
416
|
-
|
417
|
-
assert_equal 'Veterans Day', Holidays.on(date, [:us], :observed)[0][:name]
|
418
|
-
end
|
419
|
-
assert_equal 'Veterans Day', Holidays.on(Date.civil(2017, 11, 11), [:us])[0][:name]
|
134
|
+
assert_equal "Heritage Day", (Holidays.on(Date.civil(2014, 8, 4), [:ca_ab])[0] || {})[:name]
|
420
135
|
|
421
|
-
|
422
|
-
assert_equal 'Thanksgiving', Holidays.on(date, [:us])[0][:name]
|
423
|
-
end
|
136
|
+
assert_equal "Natal Day", (Holidays.on(Date.civil(2014, 8, 4), [:ca_ns])[0] || {})[:name]
|
424
137
|
|
425
|
-
|
426
|
-
%i{us_ca us_de us_fl us_ia us_il us_ks us_ky us_me us_mi us_mn us_ms us_ne us_nh us_nc us_pa
|
427
|
-
us_sc us_ok us_tn us_tx us_va us_wa us_wv}
|
428
|
-
|
429
|
-
[Date.civil(2017, 11, 24), Date.civil(2018, 11, 23), Date.civil(2019, 11, 29)].each do |date|
|
430
|
-
assert_equal [], Holidays.on(date, [:us])
|
431
|
-
assert_equal 'Family Day', Holidays.on(date, [:us_nv])[0][:name]
|
432
|
-
assert_equal 'State Holiday', Holidays.on(date, [:us_ga])[0][:name]
|
433
|
-
assert_equal "Presidents' Day", Holidays.on(date, [:us_nm])[0][:name]
|
434
|
-
assert_equal "Lincoln's Birthday", Holidays.on(date, [:us_in])[0][:name]
|
435
|
-
assert_equal 'American Indian Heritage Day', Holidays.on(date, [:us_md])[0][:name]
|
436
|
-
assert_equal 'Day after Thanksgiving (Black Friday)', Holidays.on(date, states_black_friday)[0][:name]
|
437
|
-
end
|
138
|
+
assert_equal "Civic Holiday", (Holidays.on(Date.civil(2014, 8, 4), [:ca_nt])[0] || {})[:name]
|
438
139
|
|
439
|
-
|
440
|
-
states_xmas_eve_holiday = %i{us_mi us_sc us_va}
|
441
|
-
[Date.civil(2022, 12, 23), Date.civil(2023, 12, 22), Date.civil(2028, 12, 22)].each do |date|
|
442
|
-
assert_equal 'Christmas Eve (Holiday)', Holidays.on(date, states_xmas_eve_holiday)[0][:name]
|
443
|
-
end
|
444
|
-
assert_equal 'Christmas Eve', Holidays.on(Date.civil(2017, 12, 24), states_xmas_eve)[0][:name]
|
445
|
-
assert_equal 'Christmas Eve', Holidays.on(Date.civil(2017, 12, 24), states_xmas_eve_holiday)[0][:name]
|
140
|
+
assert_equal "Civic Holiday", (Holidays.on(Date.civil(2014, 8, 4), [:ca_nu])[0] || {})[:name]
|
446
141
|
|
447
|
-
|
448
|
-
assert_equal [], Holidays.on(date, [:us])
|
449
|
-
assert_equal 'Christmas Day', Holidays.on(date, [:us], :observed)[0][:name]
|
450
|
-
end
|
451
|
-
assert_equal 'Christmas Day', Holidays.on(Date.civil(2017, 12, 25), [:us])[0][:name]
|
142
|
+
assert_equal "Civic Holiday", (Holidays.on(Date.civil(2014, 8, 4), [:ca_pe])[0] || {})[:name]
|
452
143
|
|
453
|
-
|
454
|
-
assert_equal 'Day after Christmas', Holidays.on(Date.civil(2017, 12, 26), states_day_after_christmas)[0][:name]
|
144
|
+
assert_equal "New Brunswick Day", (Holidays.on(Date.civil(2014, 8, 4), [:ca_nb])[0] || {})[:name]
|
455
145
|
|
456
|
-
assert_equal "
|
146
|
+
assert_equal "B.C. Day", (Holidays.on(Date.civil(2015, 8, 3), [:ca_bc])[0] || {})[:name]
|
457
147
|
|
148
|
+
assert_equal "Saskatchewan Day", (Holidays.on(Date.civil(2015, 8, 3), [:ca_sk])[0] || {})[:name]
|
458
149
|
|
459
|
-
|
460
|
-
|
461
|
-
Date.civil(
|
462
|
-
|
463
|
-
Date.civil(
|
464
|
-
|
465
|
-
Date.civil(
|
466
|
-
|
467
|
-
Date.civil(
|
468
|
-
|
469
|
-
|
150
|
+
assert_equal "Heritage Day", (Holidays.on(Date.civil(2015, 8, 3), [:ca_ab])[0] || {})[:name]
|
151
|
+
|
152
|
+
assert_equal "Natal Day", (Holidays.on(Date.civil(2015, 8, 3), [:ca_ns])[0] || {})[:name]
|
153
|
+
|
154
|
+
assert_equal "Civic Holiday", (Holidays.on(Date.civil(2015, 8, 3), [:ca_nt])[0] || {})[:name]
|
155
|
+
|
156
|
+
assert_equal "Civic Holiday", (Holidays.on(Date.civil(2015, 8, 3), [:ca_nu])[0] || {})[:name]
|
157
|
+
|
158
|
+
assert_equal "Civic Holiday", (Holidays.on(Date.civil(2015, 8, 3), [:ca_pe])[0] || {})[:name]
|
159
|
+
|
160
|
+
assert_equal "New Brunswick Day", (Holidays.on(Date.civil(2015, 8, 3), [:ca_nb])[0] || {})[:name]
|
161
|
+
|
162
|
+
assert_equal "Remembrance Day", (Holidays.on(Date.civil(2010, 11, 11), [:ca_ab, :ca_sk, :ca_bc, :ca_pe, :ca_nl, :ca_nt, :ca_nu, :ca_nb, :ca_yt], [:observed])[0] || {})[:name]
|
163
|
+
assert_equal "Remembrance Day", (Holidays.on(Date.civil(2012, 11, 12), [:ca_ab, :ca_sk, :ca_bc, :ca_pe, :ca_nl, :ca_nt, :ca_nu, :ca_nb, :ca_yt], [:observed])[0] || {})[:name]
|
164
|
+
assert_equal "Remembrance Day", (Holidays.on(Date.civil(2017, 11, 13), [:ca_ab, :ca_sk, :ca_bc, :ca_pe, :ca_nl, :ca_nt, :ca_nu, :ca_nb, :ca_yt], [:observed])[0] || {})[:name]
|
165
|
+
|
166
|
+
assert_equal "Remembrance Day", (Holidays.on(Date.civil(2016, 11, 11), [:ca_ab, :ca_sk, :ca_bc, :ca_pe, :ca_nl, :ca_nt, :ca_nu, :ca_nb, :ca_yt])[0] || {})[:name]
|
167
|
+
|
168
|
+
assert_equal "New Year's Day", (Holidays.on(Date.civil(2011, 1, 3), [:ca], [:observed])[0] || {})[:name]
|
169
|
+
|
170
|
+
assert_equal "New Year's Day", (Holidays.on(Date.civil(2012, 1, 2), [:ca], [:observed])[0] || {})[:name]
|
171
|
+
|
172
|
+
assert_equal "New Year's Day", (Holidays.on(Date.civil(2016, 1, 1), [:ca], [:observed])[0] || {})[:name]
|
173
|
+
|
174
|
+
assert_equal "Canada Day", (Holidays.on(Date.civil(2011, 7, 1), [:ca], [:observed])[0] || {})[:name]
|
175
|
+
|
176
|
+
assert_equal "Canada Day", (Holidays.on(Date.civil(2012, 7, 2), [:ca], [:observed])[0] || {})[:name]
|
177
|
+
|
178
|
+
assert_equal "Canada Day", (Holidays.on(Date.civil(2017, 7, 3), [:ca], [:observed])[0] || {})[:name]
|
179
|
+
|
180
|
+
assert_equal "Christmas Day", (Holidays.on(Date.civil(2010, 12, 27), [:ca], [:observed])[0] || {})[:name]
|
181
|
+
|
182
|
+
assert_equal "Christmas Day", (Holidays.on(Date.civil(2012, 12, 25), [:ca], [:observed])[0] || {})[:name]
|
183
|
+
|
184
|
+
assert_equal "Christmas Day", (Holidays.on(Date.civil(2016, 12, 26), [:ca], [:observed])[0] || {})[:name]
|
185
|
+
|
186
|
+
assert_equal "Boxing Day", (Holidays.on(Date.civil(2010, 12, 28), [:ca_on], [:observed])[0] || {})[:name]
|
187
|
+
assert_equal "Boxing Day", (Holidays.on(Date.civil(2012, 12, 26), [:ca_on], [:observed])[0] || {})[:name]
|
188
|
+
assert_equal "Boxing Day", (Holidays.on(Date.civil(2015, 12, 28), [:ca_on], [:observed])[0] || {})[:name]
|
189
|
+
assert_equal "Boxing Day", (Holidays.on(Date.civil(2016, 12, 27), [:ca_on], [:observed])[0] || {})[:name]
|
190
|
+
|
191
|
+
assert_equal "Año nuevo", (Holidays.on(Date.civil(2007, 1, 1), [:mx], [:informal])[0] || {})[:name]
|
192
|
+
|
193
|
+
assert_equal "Día de la Constitución", (Holidays.on(Date.civil(2007, 2, 5), [:mx], [:informal])[0] || {})[:name]
|
194
|
+
|
195
|
+
assert_equal "Día del Trabajo", (Holidays.on(Date.civil(2007, 5, 1), [:mx], [:informal])[0] || {})[:name]
|
196
|
+
|
197
|
+
assert_equal "Cinco de Mayo", (Holidays.on(Date.civil(2007, 5, 5), [:mx], [:informal])[0] || {})[:name]
|
198
|
+
|
199
|
+
assert_equal "Día de la Independencia", (Holidays.on(Date.civil(2007, 9, 16), [:mx], [:informal])[0] || {})[:name]
|
200
|
+
|
201
|
+
assert_equal "Todos los Santos", (Holidays.on(Date.civil(2007, 11, 1), [:mx], [:informal])[0] || {})[:name]
|
202
|
+
|
203
|
+
assert_equal "Los Fieles Difuntos", (Holidays.on(Date.civil(2007, 11, 2), [:mx], [:informal])[0] || {})[:name]
|
204
|
+
|
205
|
+
assert_equal "Día de la Revolución", (Holidays.on(Date.civil(2007, 11, 19), [:mx], [:informal])[0] || {})[:name]
|
206
|
+
|
207
|
+
assert_equal "Navidad", (Holidays.on(Date.civil(2007, 12, 25), [:mx], [:informal])[0] || {})[:name]
|
208
|
+
|
209
|
+
assert_equal "Shrove Tuesday", (Holidays.on(Date.civil(2017, 2, 28), [:us_fl])[0] || {})[:name]
|
210
|
+
assert_equal "Shrove Tuesday", (Holidays.on(Date.civil(2018, 2, 13), [:us_fl])[0] || {})[:name]
|
211
|
+
assert_equal "Shrove Tuesday", (Holidays.on(Date.civil(2019, 3, 5), [:us_fl])[0] || {})[:name]
|
212
|
+
|
213
|
+
assert_equal "Mardi Gras Day", (Holidays.on(Date.civil(2017, 2, 28), [:us_la])[0] || {})[:name]
|
214
|
+
assert_equal "Mardi Gras Day", (Holidays.on(Date.civil(2018, 2, 13), [:us_la])[0] || {})[:name]
|
215
|
+
assert_equal "Mardi Gras Day", (Holidays.on(Date.civil(2019, 3, 5), [:us_la])[0] || {})[:name]
|
216
|
+
|
217
|
+
assert_nil (Holidays.on(Date.civil(2017, 2, 28), [:us])[0] || {})[:name]
|
218
|
+
assert_nil (Holidays.on(Date.civil(2018, 2, 13), [:us])[0] || {})[:name]
|
219
|
+
assert_nil (Holidays.on(Date.civil(2019, 3, 5), [:us])[0] || {})[:name]
|
220
|
+
|
221
|
+
assert_equal "Good Friday", (Holidays.on(Date.civil(2017, 4, 14), [:us_ct, :us_de, :us_gu, :us_hi, :us_in, :us_ky, :us_la, :us_nj, :us_nc, :us_nd, :us_pr, :us_tn])[0] || {})[:name]
|
222
|
+
assert_equal "Good Friday", (Holidays.on(Date.civil(2018, 3, 30), [:us_ct, :us_de, :us_gu, :us_hi, :us_in, :us_ky, :us_la, :us_nj, :us_nc, :us_nd, :us_pr, :us_tn])[0] || {})[:name]
|
223
|
+
assert_equal "Good Friday", (Holidays.on(Date.civil(2019, 4, 19), [:us_ct, :us_de, :us_gu, :us_hi, :us_in, :us_ky, :us_la, :us_nj, :us_nc, :us_nd, :us_pr, :us_tn])[0] || {})[:name]
|
224
|
+
|
225
|
+
assert_equal "Good Friday", (Holidays.on(Date.civil(2017, 4, 14), [:us], [:informal])[0] || {})[:name]
|
226
|
+
assert_equal "Good Friday", (Holidays.on(Date.civil(2018, 3, 30), [:us], [:informal])[0] || {})[:name]
|
227
|
+
assert_equal "Good Friday", (Holidays.on(Date.civil(2019, 4, 19), [:us], [:informal])[0] || {})[:name]
|
228
|
+
|
229
|
+
assert_nil (Holidays.on(Date.civil(2017, 2, 28), [:us])[0] || {})[:name]
|
230
|
+
assert_nil (Holidays.on(Date.civil(2018, 2, 13), [:us])[0] || {})[:name]
|
231
|
+
assert_nil (Holidays.on(Date.civil(2019, 3, 5), [:us])[0] || {})[:name]
|
232
|
+
|
233
|
+
assert_nil (Holidays.on(Date.civil(2017, 4, 16), [:us])[0] || {})[:name]
|
234
|
+
assert_nil (Holidays.on(Date.civil(2018, 4, 1), [:us])[0] || {})[:name]
|
235
|
+
assert_nil (Holidays.on(Date.civil(2019, 4, 21), [:us])[0] || {})[:name]
|
236
|
+
|
237
|
+
assert_equal "Easter Sunday", (Holidays.on(Date.civil(2017, 4, 16), [:us], [:informal])[0] || {})[:name]
|
238
|
+
assert_equal "Easter Sunday", (Holidays.on(Date.civil(2018, 4, 1), [:us], [:informal])[0] || {})[:name]
|
239
|
+
assert_equal "Easter Sunday", (Holidays.on(Date.civil(2019, 4, 21), [:us], [:informal])[0] || {})[:name]
|
240
|
+
|
241
|
+
assert_equal "New Year's Day", (Holidays.on(Date.civil(2017, 1, 1), [:us])[0] || {})[:name]
|
242
|
+
|
243
|
+
assert_equal "New Year's Day", (Holidays.on(Date.civil(2017, 1, 2), [:us], [:observed])[0] || {})[:name]
|
244
|
+
|
245
|
+
assert_equal "Martin Luther King, Jr. Day", (Holidays.on(Date.civil(2017, 1, 16), [:us])[0] || {})[:name]
|
246
|
+
assert_equal "Martin Luther King, Jr. Day", (Holidays.on(Date.civil(2018, 1, 15), [:us])[0] || {})[:name]
|
247
|
+
assert_equal "Martin Luther King, Jr. Day", (Holidays.on(Date.civil(2019, 1, 21), [:us])[0] || {})[:name]
|
248
|
+
|
249
|
+
assert_equal "Martin Luther King, Jr. Day", (Holidays.on(Date.civil(2016, 1, 18), [:us])[0] || {})[:name]
|
250
|
+
assert_equal "Martin Luther King, Jr. Day", (Holidays.on(Date.civil(2017, 1, 16), [:us])[0] || {})[:name]
|
251
|
+
assert_equal "Martin Luther King, Jr. Day", (Holidays.on(Date.civil(2018, 1, 15), [:us])[0] || {})[:name]
|
252
|
+
|
253
|
+
assert_equal "Martin Luther King's and Robert E. Lee's Birthdays", (Holidays.on(Date.civil(2016, 1, 18), [:us_ms])[0] || {})[:name]
|
254
|
+
assert_equal "Martin Luther King's and Robert E. Lee's Birthdays", (Holidays.on(Date.civil(2017, 1, 16), [:us_ms])[0] || {})[:name]
|
255
|
+
assert_equal "Martin Luther King's and Robert E. Lee's Birthdays", (Holidays.on(Date.civil(2018, 1, 15), [:us_ms])[0] || {})[:name]
|
256
|
+
|
257
|
+
assert_equal "Idaho Human Rights Day", (Holidays.on(Date.civil(2016, 1, 18), [:us_id])[0] || {})[:name]
|
258
|
+
assert_equal "Idaho Human Rights Day", (Holidays.on(Date.civil(2017, 1, 16), [:us_id])[0] || {})[:name]
|
259
|
+
assert_equal "Idaho Human Rights Day", (Holidays.on(Date.civil(2018, 1, 15), [:us_id])[0] || {})[:name]
|
260
|
+
|
261
|
+
assert_equal "Civil Rights Day", (Holidays.on(Date.civil(2016, 1, 18), [:us_ar])[0] || {})[:name]
|
262
|
+
assert_equal "Civil Rights Day", (Holidays.on(Date.civil(2017, 1, 16), [:us_ar])[0] || {})[:name]
|
263
|
+
assert_equal "Civil Rights Day", (Holidays.on(Date.civil(2018, 1, 15), [:us_ar])[0] || {})[:name]
|
264
|
+
|
265
|
+
assert_nil (Holidays.on(Date.civil(2017, 1, 20), [:us])[0] || {})[:name]
|
266
|
+
assert_nil (Holidays.on(Date.civil(2021, 1, 20), [:us])[0] || {})[:name]
|
267
|
+
|
268
|
+
assert_equal "Inauguration Day", (Holidays.on(Date.civil(2017, 1, 20), [:us_tx, :us_dc, :us_la, :us_md, :us_va])[0] || {})[:name]
|
269
|
+
assert_equal "Inauguration Day", (Holidays.on(Date.civil(2021, 1, 20), [:us_tx, :us_dc, :us_la, :us_md, :us_va])[0] || {})[:name]
|
270
|
+
|
271
|
+
assert_nil (Holidays.on(Date.civil(2017, 1, 13), [:us])[0] || {})[:name]
|
272
|
+
assert_nil (Holidays.on(Date.civil(2018, 1, 12), [:us])[0] || {})[:name]
|
273
|
+
assert_nil (Holidays.on(Date.civil(2019, 1, 18), [:us])[0] || {})[:name]
|
274
|
+
|
275
|
+
assert_equal "Lee-Jackson Day", (Holidays.on(Date.civil(2017, 1, 13), [:us_va])[0] || {})[:name]
|
276
|
+
assert_equal "Lee-Jackson Day", (Holidays.on(Date.civil(2018, 1, 12), [:us_va])[0] || {})[:name]
|
277
|
+
assert_equal "Lee-Jackson Day", (Holidays.on(Date.civil(2019, 1, 18), [:us_va])[0] || {})[:name]
|
278
|
+
|
279
|
+
assert_equal "Confederate Heroes Day", (Holidays.on(Date.civil(2017, 1, 19), [:us_tx])[0] || {})[:name]
|
280
|
+
|
281
|
+
assert_equal "Presidents' Day", (Holidays.on(Date.civil(2008, 2, 18), [:us])[0] || {})[:name]
|
282
|
+
assert_equal "Presidents' Day", (Holidays.on(Date.civil(2017, 2, 20), [:us])[0] || {})[:name]
|
283
|
+
assert_equal "Presidents' Day", (Holidays.on(Date.civil(2018, 2, 19), [:us])[0] || {})[:name]
|
284
|
+
|
285
|
+
assert_nil (Holidays.on(Date.civil(2017, 3, 6), [:us])[0] || {})[:name]
|
286
|
+
assert_nil (Holidays.on(Date.civil(2018, 3, 5), [:us])[0] || {})[:name]
|
287
|
+
assert_nil (Holidays.on(Date.civil(2019, 3, 4), [:us])[0] || {})[:name]
|
288
|
+
|
289
|
+
assert_equal "Casimir Pulaski Day", (Holidays.on(Date.civil(2017, 3, 6), [:us_il])[0] || {})[:name]
|
290
|
+
assert_equal "Casimir Pulaski Day", (Holidays.on(Date.civil(2018, 3, 5), [:us_il])[0] || {})[:name]
|
291
|
+
assert_equal "Casimir Pulaski Day", (Holidays.on(Date.civil(2019, 3, 4), [:us_il])[0] || {})[:name]
|
292
|
+
|
293
|
+
assert_nil (Holidays.on(Date.civil(2017, 3, 7), [:us])[0] || {})[:name]
|
294
|
+
assert_nil (Holidays.on(Date.civil(2018, 3, 6), [:us])[0] || {})[:name]
|
295
|
+
assert_nil (Holidays.on(Date.civil(2019, 3, 5), [:us])[0] || {})[:name]
|
296
|
+
|
297
|
+
assert_equal "Town Meeting Day", (Holidays.on(Date.civil(2017, 3, 7), [:us_vt])[0] || {})[:name]
|
298
|
+
assert_equal "Town Meeting Day", (Holidays.on(Date.civil(2018, 3, 6), [:us_vt])[0] || {})[:name]
|
299
|
+
assert_equal "Town Meeting Day", (Holidays.on(Date.civil(2019, 3, 5), [:us_vt])[0] || {})[:name]
|
300
|
+
|
301
|
+
assert_equal "Texas Independence Day", (Holidays.on(Date.civil(2017, 3, 2), [:us_tx])[0] || {})[:name]
|
302
|
+
|
303
|
+
assert_nil (Holidays.on(Date.civil(2017, 3, 27), [:us], [:observed])[0] || {})[:name]
|
304
|
+
assert_nil (Holidays.on(Date.civil(2018, 3, 26), [:us], [:observed])[0] || {})[:name]
|
305
|
+
assert_nil (Holidays.on(Date.civil(2022, 3, 25), [:us], [:observed])[0] || {})[:name]
|
306
|
+
|
307
|
+
assert_equal "Prince Jonah Kuhio Kalanianaole Day", (Holidays.on(Date.civil(2017, 3, 27), [:us_hi], [:observed])[0] || {})[:name]
|
308
|
+
assert_equal "Prince Jonah Kuhio Kalanianaole Day", (Holidays.on(Date.civil(2018, 3, 26), [:us_hi], [:observed])[0] || {})[:name]
|
309
|
+
assert_equal "Prince Jonah Kuhio Kalanianaole Day", (Holidays.on(Date.civil(2022, 3, 25), [:us_hi], [:observed])[0] || {})[:name]
|
310
|
+
|
311
|
+
assert_nil (Holidays.on(Date.civil(2017, 3, 26), [:us])[0] || {})[:name]
|
312
|
+
|
313
|
+
assert_equal "Prince Jonah Kuhio Kalanianaole Day", (Holidays.on(Date.civil(2017, 3, 26), [:us_hi])[0] || {})[:name]
|
314
|
+
|
315
|
+
assert_nil (Holidays.on(Date.civil(2017, 3, 27), [:us])[0] || {})[:name]
|
316
|
+
assert_nil (Holidays.on(Date.civil(2018, 3, 26), [:us])[0] || {})[:name]
|
317
|
+
assert_nil (Holidays.on(Date.civil(2019, 3, 25), [:us])[0] || {})[:name]
|
318
|
+
|
319
|
+
assert_equal "Seward's Day", (Holidays.on(Date.civil(2017, 3, 27), [:us_ak])[0] || {})[:name]
|
320
|
+
assert_equal "Seward's Day", (Holidays.on(Date.civil(2018, 3, 26), [:us_ak])[0] || {})[:name]
|
321
|
+
assert_equal "Seward's Day", (Holidays.on(Date.civil(2019, 3, 25), [:us_ak])[0] || {})[:name]
|
322
|
+
|
323
|
+
assert_equal "César Chávez Day", (Holidays.on(Date.civil(2017, 3, 31), [:us_ca])[0] || {})[:name]
|
324
|
+
|
325
|
+
assert_equal "Emancipation Day", (Holidays.on(Date.civil(2023, 4, 17), [:us_dc, :us_ca], [:observed])[0] || {})[:name]
|
326
|
+
assert_equal "Emancipation Day", (Holidays.on(Date.civil(2022, 4, 15), [:us_dc, :us_ca], [:observed])[0] || {})[:name]
|
327
|
+
assert_equal "Emancipation Day", (Holidays.on(Date.civil(2028, 4, 17), [:us_dc, :us_ca], [:observed])[0] || {})[:name]
|
328
|
+
|
329
|
+
assert_equal "Emancipation Day", (Holidays.on(Date.civil(2017, 4, 16), [:us_dc, :us_ca])[0] || {})[:name]
|
330
|
+
|
331
|
+
assert_nil (Holidays.on(Date.civil(2017, 4, 17), [:us])[0] || {})[:name]
|
332
|
+
assert_nil (Holidays.on(Date.civil(2018, 4, 16), [:us])[0] || {})[:name]
|
333
|
+
assert_nil (Holidays.on(Date.civil(2019, 4, 15), [:us])[0] || {})[:name]
|
334
|
+
|
335
|
+
assert_equal "Patriots' Day", (Holidays.on(Date.civil(2017, 4, 17), [:us_me, :us_ma])[0] || {})[:name]
|
336
|
+
assert_equal "Patriots' Day", (Holidays.on(Date.civil(2018, 4, 16), [:us_me, :us_ma])[0] || {})[:name]
|
337
|
+
assert_equal "Patriots' Day", (Holidays.on(Date.civil(2019, 4, 15), [:us_me, :us_ma])[0] || {})[:name]
|
338
|
+
|
339
|
+
assert_equal "San Jacinto Day", (Holidays.on(Date.civil(2017, 4, 21), [:us_tx])[0] || {})[:name]
|
340
|
+
|
341
|
+
assert_nil (Holidays.on(Date.civil(2017, 4, 24), [:us])[0] || {})[:name]
|
342
|
+
assert_nil (Holidays.on(Date.civil(2018, 4, 30), [:us])[0] || {})[:name]
|
343
|
+
assert_nil (Holidays.on(Date.civil(2019, 4, 29), [:us])[0] || {})[:name]
|
344
|
+
|
345
|
+
assert_equal "Confederate Memorial Day", (Holidays.on(Date.civil(2017, 4, 24), [:us_al, :us_ms])[0] || {})[:name]
|
346
|
+
assert_equal "Confederate Memorial Day", (Holidays.on(Date.civil(2018, 4, 30), [:us_al, :us_ms])[0] || {})[:name]
|
347
|
+
assert_equal "Confederate Memorial Day", (Holidays.on(Date.civil(2019, 4, 29), [:us_al, :us_ms])[0] || {})[:name]
|
348
|
+
|
349
|
+
assert_nil (Holidays.on(Date.civil(2015, 4, 27), [:us])[0] || {})[:name]
|
350
|
+
assert_nil (Holidays.on(Date.civil(2020, 4, 27), [:us])[0] || {})[:name]
|
351
|
+
assert_nil (Holidays.on(Date.civil(2026, 4, 27), [:us])[0] || {})[:name]
|
352
|
+
|
353
|
+
assert_equal "Confederate Memorial Day", (Holidays.on(Date.civil(2015, 4, 27), [:us_fl], [:observed])[0] || {})[:name]
|
354
|
+
assert_equal "Confederate Memorial Day", (Holidays.on(Date.civil(2020, 4, 27), [:us_fl], [:observed])[0] || {})[:name]
|
355
|
+
assert_equal "Confederate Memorial Day", (Holidays.on(Date.civil(2026, 4, 27), [:us_fl], [:observed])[0] || {})[:name]
|
356
|
+
|
357
|
+
assert_nil (Holidays.on(Date.civil(2017, 4, 26), [:us])[0] || {})[:name]
|
358
|
+
|
359
|
+
assert_equal "Confederate Memorial Day", (Holidays.on(Date.civil(2017, 4, 26), [:us_fl])[0] || {})[:name]
|
360
|
+
|
361
|
+
assert_nil (Holidays.on(Date.civil(2015, 4, 20), [:us])[0] || {})[:name]
|
362
|
+
assert_nil (Holidays.on(Date.civil(2021, 4, 26), [:us])[0] || {})[:name]
|
363
|
+
|
364
|
+
assert_equal "State Holiday", (Holidays.on(Date.civil(2015, 4, 20), [:us_ga])[0] || {})[:name]
|
365
|
+
assert_equal "State Holiday", (Holidays.on(Date.civil(2021, 4, 26), [:us_ga])[0] || {})[:name]
|
366
|
+
|
367
|
+
assert_equal "Arbor Day", (Holidays.on(Date.civil(2017, 4, 28), [:us_ne])[0] || {})[:name]
|
368
|
+
|
369
|
+
assert_equal "Truman Day", (Holidays.on(Date.civil(2017, 5, 8), [:us_mo])[0] || {})[:name]
|
370
|
+
|
371
|
+
assert_equal "Confederate Memorial Day", (Holidays.on(Date.civil(2017, 5, 10), [:us_sc])[0] || {})[:name]
|
372
|
+
|
373
|
+
assert_equal "Memorial Day", (Holidays.on(Date.civil(2017, 5, 29), [:us])[0] || {})[:name]
|
374
|
+
assert_equal "Memorial Day", (Holidays.on(Date.civil(2018, 5, 28), [:us])[0] || {})[:name]
|
375
|
+
assert_equal "Memorial Day", (Holidays.on(Date.civil(2019, 5, 27), [:us])[0] || {})[:name]
|
376
|
+
|
377
|
+
assert_nil (Holidays.on(Date.civil(2017, 6, 5), [:us])[0] || {})[:name]
|
378
|
+
assert_nil (Holidays.on(Date.civil(2018, 6, 4), [:us])[0] || {})[:name]
|
379
|
+
assert_nil (Holidays.on(Date.civil(2019, 6, 3), [:us])[0] || {})[:name]
|
380
|
+
|
381
|
+
assert_equal "Jefferson Davis' Birthday", (Holidays.on(Date.civil(2017, 6, 5), [:us_al])[0] || {})[:name]
|
382
|
+
assert_equal "Jefferson Davis' Birthday", (Holidays.on(Date.civil(2018, 6, 4), [:us_al])[0] || {})[:name]
|
383
|
+
assert_equal "Jefferson Davis' Birthday", (Holidays.on(Date.civil(2019, 6, 3), [:us_al])[0] || {})[:name]
|
384
|
+
|
385
|
+
assert_equal "Birthday of Jefferson Davis", (Holidays.on(Date.civil(2017, 6, 3), [:us_fl])[0] || {})[:name]
|
386
|
+
|
387
|
+
assert_nil (Holidays.on(Date.civil(2017, 6, 12), [:us])[0] || {})[:name]
|
388
|
+
assert_nil (Holidays.on(Date.civil(2018, 6, 11), [:us])[0] || {})[:name]
|
389
|
+
assert_nil (Holidays.on(Date.civil(2022, 6, 10), [:us])[0] || {})[:name]
|
390
|
+
|
391
|
+
assert_equal "King Kamehameha I Day", (Holidays.on(Date.civil(2017, 6, 12), [:us_hi], [:observed])[0] || {})[:name]
|
392
|
+
assert_equal "King Kamehameha I Day", (Holidays.on(Date.civil(2018, 6, 11), [:us_hi], [:observed])[0] || {})[:name]
|
393
|
+
assert_equal "King Kamehameha I Day", (Holidays.on(Date.civil(2022, 6, 10), [:us_hi], [:observed])[0] || {})[:name]
|
394
|
+
|
395
|
+
assert_nil (Holidays.on(Date.civil(2017, 6, 11), [:us])[0] || {})[:name]
|
396
|
+
|
397
|
+
assert_equal "King Kamehameha I Day", (Holidays.on(Date.civil(2017, 6, 11), [:us_hi])[0] || {})[:name]
|
398
|
+
|
399
|
+
assert_equal "Emancipation Day in Texas", (Holidays.on(Date.civil(2017, 6, 19), [:us_tx])[0] || {})[:name]
|
400
|
+
|
401
|
+
assert_nil (Holidays.on(Date.civil(2017, 6, 20), [:us])[0] || {})[:name]
|
402
|
+
assert_nil (Holidays.on(Date.civil(2020, 6, 19), [:us])[0] || {})[:name]
|
403
|
+
assert_nil (Holidays.on(Date.civil(2021, 6, 21), [:us])[0] || {})[:name]
|
404
|
+
|
405
|
+
assert_equal "West Virginia Day", (Holidays.on(Date.civil(2017, 6, 20), [:us_wv], [:observed])[0] || {})[:name]
|
406
|
+
assert_equal "West Virginia Day", (Holidays.on(Date.civil(2020, 6, 19), [:us_wv], [:observed])[0] || {})[:name]
|
407
|
+
assert_equal "West Virginia Day", (Holidays.on(Date.civil(2021, 6, 21), [:us_wv], [:observed])[0] || {})[:name]
|
408
|
+
|
409
|
+
assert_equal "West Virginia Day", (Holidays.on(Date.civil(2017, 6, 20), [:us_wv])[0] || {})[:name]
|
410
|
+
|
411
|
+
assert_equal "Emancipation Day", (Holidays.on(Date.civil(2017, 7, 3), [:us_vi])[0] || {})[:name]
|
412
|
+
|
413
|
+
assert_equal "Independence Day", (Holidays.on(Date.civil(2020, 7, 4), [:us, :us_va])[0] || {})[:name]
|
414
|
+
assert_equal "Independence Day", (Holidays.on(Date.civil(2021, 7, 4), [:us, :us_va])[0] || {})[:name]
|
415
|
+
assert_equal "Independence Day", (Holidays.on(Date.civil(2026, 7, 4), [:us, :us_va])[0] || {})[:name]
|
416
|
+
|
417
|
+
assert_nil (Holidays.on(Date.civil(2020, 7, 3), [:us])[0] || {})[:name]
|
418
|
+
assert_nil (Holidays.on(Date.civil(2021, 7, 5), [:us])[0] || {})[:name]
|
419
|
+
assert_nil (Holidays.on(Date.civil(2026, 7, 3), [:us])[0] || {})[:name]
|
420
|
+
|
421
|
+
assert_equal "Independence Day (Holiday)", (Holidays.on(Date.civil(2020, 7, 3), [:us_va])[0] || {})[:name]
|
422
|
+
assert_equal "Independence Day (Holiday)", (Holidays.on(Date.civil(2021, 7, 5), [:us_va])[0] || {})[:name]
|
423
|
+
assert_equal "Independence Day (Holiday)", (Holidays.on(Date.civil(2026, 7, 3), [:us_va])[0] || {})[:name]
|
424
|
+
|
425
|
+
assert_equal "Pioneer Day", (Holidays.on(Date.civil(2020, 7, 24), [:us_ut])[0] || {})[:name]
|
426
|
+
|
427
|
+
assert_nil (Holidays.on(Date.civil(2017, 8, 14), [:us])[0] || {})[:name]
|
428
|
+
assert_nil (Holidays.on(Date.civil(2020, 8, 10), [:us])[0] || {})[:name]
|
429
|
+
assert_nil (Holidays.on(Date.civil(2021, 8, 9), [:us])[0] || {})[:name]
|
430
|
+
|
431
|
+
assert_equal "Victory Day", (Holidays.on(Date.civil(2017, 8, 14), [:us_ri])[0] || {})[:name]
|
432
|
+
assert_equal "Victory Day", (Holidays.on(Date.civil(2020, 8, 10), [:us_ri])[0] || {})[:name]
|
433
|
+
assert_equal "Victory Day", (Holidays.on(Date.civil(2021, 8, 9), [:us_ri])[0] || {})[:name]
|
434
|
+
|
435
|
+
assert_nil (Holidays.on(Date.civil(2017, 8, 16), [:us])[0] || {})[:name]
|
436
|
+
assert_nil (Holidays.on(Date.civil(2020, 8, 17), [:us])[0] || {})[:name]
|
437
|
+
assert_nil (Holidays.on(Date.civil(2025, 8, 15), [:us])[0] || {})[:name]
|
438
|
+
|
439
|
+
assert_equal "Bennington Battle Day", (Holidays.on(Date.civil(2017, 8, 16), [:us_vt], [:observed])[0] || {})[:name]
|
440
|
+
assert_equal "Bennington Battle Day", (Holidays.on(Date.civil(2020, 8, 17), [:us_vt], [:observed])[0] || {})[:name]
|
441
|
+
assert_equal "Bennington Battle Day", (Holidays.on(Date.civil(2025, 8, 15), [:us_vt], [:observed])[0] || {})[:name]
|
442
|
+
|
443
|
+
assert_equal "Bennington Battle Day", (Holidays.on(Date.civil(2017, 8, 16), [:us_vt])[0] || {})[:name]
|
444
|
+
|
445
|
+
assert_nil (Holidays.on(Date.civil(2017, 8, 18), [:us])[0] || {})[:name]
|
446
|
+
assert_nil (Holidays.on(Date.civil(2020, 8, 21), [:us])[0] || {})[:name]
|
447
|
+
assert_nil (Holidays.on(Date.civil(2025, 8, 15), [:us])[0] || {})[:name]
|
448
|
+
|
449
|
+
assert_equal "Statehood Day", (Holidays.on(Date.civil(2017, 8, 18), [:us_hi])[0] || {})[:name]
|
450
|
+
assert_equal "Statehood Day", (Holidays.on(Date.civil(2020, 8, 21), [:us_hi])[0] || {})[:name]
|
451
|
+
assert_equal "Statehood Day", (Holidays.on(Date.civil(2025, 8, 15), [:us_hi])[0] || {})[:name]
|
452
|
+
|
453
|
+
assert_equal "Lyndon Baines Johnson Day", (Holidays.on(Date.civil(2017, 8, 27), [:us_tx])[0] || {})[:name]
|
454
|
+
|
455
|
+
assert_equal "Labor Day", (Holidays.on(Date.civil(2017, 9, 4), [:us])[0] || {})[:name]
|
456
|
+
assert_equal "Labor Day", (Holidays.on(Date.civil(2018, 9, 3), [:us])[0] || {})[:name]
|
457
|
+
assert_equal "Labor Day", (Holidays.on(Date.civil(2019, 9, 2), [:us])[0] || {})[:name]
|
458
|
+
|
459
|
+
assert_nil (Holidays.on(Date.civil(2017, 9, 21), [:us])[0] || {})[:name]
|
460
|
+
assert_nil (Holidays.on(Date.civil(2018, 9, 10), [:us])[0] || {})[:name]
|
461
|
+
assert_nil (Holidays.on(Date.civil(2019, 9, 30), [:us])[0] || {})[:name]
|
462
|
+
|
463
|
+
assert_equal "Rosh Hashanah", (Holidays.on(Date.civil(2017, 9, 21), [:us_tx])[0] || {})[:name]
|
464
|
+
assert_equal "Rosh Hashanah", (Holidays.on(Date.civil(2018, 9, 10), [:us_tx])[0] || {})[:name]
|
465
|
+
assert_equal "Rosh Hashanah", (Holidays.on(Date.civil(2019, 9, 30), [:us_tx])[0] || {})[:name]
|
466
|
+
|
467
|
+
assert_nil (Holidays.on(Date.civil(2017, 9, 30), [:us])[0] || {})[:name]
|
468
|
+
assert_nil (Holidays.on(Date.civil(2018, 9, 19), [:us])[0] || {})[:name]
|
469
|
+
assert_nil (Holidays.on(Date.civil(2019, 10, 9), [:us])[0] || {})[:name]
|
470
|
+
|
471
|
+
assert_equal "Yom Kippur", (Holidays.on(Date.civil(2017, 9, 30), [:us_tx])[0] || {})[:name]
|
472
|
+
assert_equal "Yom Kippur", (Holidays.on(Date.civil(2018, 9, 19), [:us_tx])[0] || {})[:name]
|
473
|
+
assert_equal "Yom Kippur", (Holidays.on(Date.civil(2019, 10, 9), [:us_tx])[0] || {})[:name]
|
474
|
+
|
475
|
+
assert_nil (Holidays.on(Date.civil(2017, 10, 9), [:us])[0] || {})[:name]
|
476
|
+
assert_nil (Holidays.on(Date.civil(2018, 10, 8), [:us])[0] || {})[:name]
|
477
|
+
assert_nil (Holidays.on(Date.civil(2019, 10, 14), [:us])[0] || {})[:name]
|
478
|
+
|
479
|
+
assert_equal "Columbus Day", (Holidays.on(Date.civil(2017, 10, 9), [:us_al, :us_az, :us_co, :us_ct, :us_dc, :us_ga, :us_id, :us_il, :us_in, :us_ma, :us_md, :us_me, :us_mo, :us_mt, :us_ne, :us_nj, :us_nm, :us_ny, :us_oh, :us_pa, :us_ri, :us_ut, :us_va, :us_wv])[0] || {})[:name]
|
480
|
+
assert_equal "Columbus Day", (Holidays.on(Date.civil(2018, 10, 8), [:us_al, :us_az, :us_co, :us_ct, :us_dc, :us_ga, :us_id, :us_il, :us_in, :us_ma, :us_md, :us_me, :us_mo, :us_mt, :us_ne, :us_nj, :us_nm, :us_ny, :us_oh, :us_pa, :us_ri, :us_ut, :us_va, :us_wv])[0] || {})[:name]
|
481
|
+
assert_equal "Columbus Day", (Holidays.on(Date.civil(2019, 10, 14), [:us_al, :us_az, :us_co, :us_ct, :us_dc, :us_ga, :us_id, :us_il, :us_in, :us_ma, :us_md, :us_me, :us_mo, :us_mt, :us_ne, :us_nj, :us_nm, :us_ny, :us_oh, :us_pa, :us_ri, :us_ut, :us_va, :us_wv])[0] || {})[:name]
|
482
|
+
|
483
|
+
assert_equal "Columbus Day", (Holidays.on(Date.civil(2017, 10, 9), [:us_ak, :us_ar, :us_ca, :us_de, :us_fl, :us_hi, :us_mi, :us_mn, :us_nd, :us_nv, :us_or, :us_sd, :us_tx, :us_vt, :us_wa, :us_wi, :us_wy], [:informal])[0] || {})[:name]
|
484
|
+
assert_equal "Columbus Day", (Holidays.on(Date.civil(2018, 10, 8), [:us_ak, :us_ar, :us_ca, :us_de, :us_fl, :us_hi, :us_mi, :us_mn, :us_nd, :us_nv, :us_or, :us_sd, :us_tx, :us_vt, :us_wa, :us_wi, :us_wy], [:informal])[0] || {})[:name]
|
485
|
+
assert_equal "Columbus Day", (Holidays.on(Date.civil(2019, 10, 14), [:us_ak, :us_ar, :us_ca, :us_de, :us_fl, :us_hi, :us_mi, :us_mn, :us_nd, :us_nv, :us_or, :us_sd, :us_tx, :us_vt, :us_wa, :us_wi, :us_wy], [:informal])[0] || {})[:name]
|
486
|
+
|
487
|
+
assert_nil (Holidays.on(Date.civil(2017, 10, 9), [:us_ak, :us_ar, :us_ca, :us_de, :us_fl, :us_hi, :us_mi, :us_mn, :us_nd, :us_nv, :us_or, :us_sd, :us_tx, :us_vt, :us_wa, :us_wi, :us_wy])[0] || {})[:name]
|
488
|
+
assert_nil (Holidays.on(Date.civil(2018, 10, 8), [:us_ak, :us_ar, :us_ca, :us_de, :us_fl, :us_hi, :us_mi, :us_mn, :us_nd, :us_nv, :us_or, :us_sd, :us_tx, :us_vt, :us_wa, :us_wi, :us_wy])[0] || {})[:name]
|
489
|
+
assert_nil (Holidays.on(Date.civil(2019, 10, 14), [:us_ak, :us_ar, :us_ca, :us_de, :us_fl, :us_hi, :us_mi, :us_mn, :us_nd, :us_nv, :us_or, :us_sd, :us_tx, :us_vt, :us_wa, :us_wi, :us_wy])[0] || {})[:name]
|
490
|
+
|
491
|
+
assert_equal "Alaska Day", (Holidays.on(Date.civil(2017, 10, 18), [:us_ak])[0] || {})[:name]
|
492
|
+
|
493
|
+
assert_nil (Holidays.on(Date.civil(2017, 10, 27), [:us])[0] || {})[:name]
|
494
|
+
assert_nil (Holidays.on(Date.civil(2018, 10, 26), [:us])[0] || {})[:name]
|
495
|
+
assert_nil (Holidays.on(Date.civil(2019, 10, 25), [:us])[0] || {})[:name]
|
496
|
+
|
497
|
+
assert_equal "Nevada Day", (Holidays.on(Date.civil(2017, 10, 27), [:us_nv])[0] || {})[:name]
|
498
|
+
assert_equal "Nevada Day", (Holidays.on(Date.civil(2018, 10, 26), [:us_nv])[0] || {})[:name]
|
499
|
+
assert_equal "Nevada Day", (Holidays.on(Date.civil(2019, 10, 25), [:us_nv])[0] || {})[:name]
|
500
|
+
|
501
|
+
assert_nil (Holidays.on(Date.civil(2017, 11, 7), [:us])[0] || {})[:name]
|
502
|
+
assert_nil (Holidays.on(Date.civil(2018, 11, 6), [:us])[0] || {})[:name]
|
503
|
+
assert_nil (Holidays.on(Date.civil(2021, 11, 2), [:us])[0] || {})[:name]
|
504
|
+
|
505
|
+
assert_equal "Election Day", (Holidays.on(Date.civil(2017, 11, 7), [:us_de, :us_hi, :us_il, :us_in, :us_mt, :us_nj, :us_ny, :us_pa, :us_ri])[0] || {})[:name]
|
506
|
+
assert_equal "Election Day", (Holidays.on(Date.civil(2018, 11, 6), [:us_de, :us_hi, :us_il, :us_in, :us_mt, :us_nj, :us_ny, :us_pa, :us_ri])[0] || {})[:name]
|
507
|
+
assert_equal "Election Day", (Holidays.on(Date.civil(2021, 11, 2), [:us_de, :us_hi, :us_il, :us_in, :us_mt, :us_nj, :us_ny, :us_pa, :us_ri])[0] || {})[:name]
|
508
|
+
|
509
|
+
assert_equal "Veterans Day", (Holidays.on(Date.civil(2017, 11, 10), [:us], [:observed])[0] || {})[:name]
|
510
|
+
assert_equal "Veterans Day", (Holidays.on(Date.civil(2018, 11, 12), [:us], [:observed])[0] || {})[:name]
|
511
|
+
assert_equal "Veterans Day", (Holidays.on(Date.civil(2019, 11, 11), [:us], [:observed])[0] || {})[:name]
|
512
|
+
|
513
|
+
assert_equal "Veterans Day", (Holidays.on(Date.civil(2017, 11, 11), [:us])[0] || {})[:name]
|
514
|
+
|
515
|
+
assert_equal "Thanksgiving", (Holidays.on(Date.civil(2017, 11, 23), [:us])[0] || {})[:name]
|
516
|
+
assert_equal "Thanksgiving", (Holidays.on(Date.civil(2018, 11, 22), [:us])[0] || {})[:name]
|
517
|
+
assert_equal "Thanksgiving", (Holidays.on(Date.civil(2019, 11, 28), [:us])[0] || {})[:name]
|
518
|
+
|
519
|
+
assert_nil (Holidays.on(Date.civil(2017, 11, 24), [:us])[0] || {})[:name]
|
520
|
+
assert_nil (Holidays.on(Date.civil(2018, 11, 23), [:us])[0] || {})[:name]
|
521
|
+
assert_nil (Holidays.on(Date.civil(2019, 11, 29), [:us])[0] || {})[:name]
|
522
|
+
|
523
|
+
assert_equal "Family Day", (Holidays.on(Date.civil(2017, 11, 24), [:us_nv])[0] || {})[:name]
|
524
|
+
assert_equal "Family Day", (Holidays.on(Date.civil(2018, 11, 23), [:us_nv])[0] || {})[:name]
|
525
|
+
assert_equal "Family Day", (Holidays.on(Date.civil(2019, 11, 29), [:us_nv])[0] || {})[:name]
|
526
|
+
|
527
|
+
assert_equal "State Holiday", (Holidays.on(Date.civil(2017, 11, 24), [:us_ga])[0] || {})[:name]
|
528
|
+
assert_equal "State Holiday", (Holidays.on(Date.civil(2018, 11, 23), [:us_ga])[0] || {})[:name]
|
529
|
+
assert_equal "State Holiday", (Holidays.on(Date.civil(2019, 11, 29), [:us_ga])[0] || {})[:name]
|
530
|
+
|
531
|
+
assert_equal "Presidents' Day", (Holidays.on(Date.civil(2017, 11, 24), [:us_nm])[0] || {})[:name]
|
532
|
+
assert_equal "Presidents' Day", (Holidays.on(Date.civil(2018, 11, 23), [:us_nm])[0] || {})[:name]
|
533
|
+
assert_equal "Presidents' Day", (Holidays.on(Date.civil(2019, 11, 29), [:us_nm])[0] || {})[:name]
|
534
|
+
|
535
|
+
assert_equal "Lincoln's Birthday", (Holidays.on(Date.civil(2017, 11, 24), [:us_in])[0] || {})[:name]
|
536
|
+
assert_equal "Lincoln's Birthday", (Holidays.on(Date.civil(2018, 11, 23), [:us_in])[0] || {})[:name]
|
537
|
+
assert_equal "Lincoln's Birthday", (Holidays.on(Date.civil(2019, 11, 29), [:us_in])[0] || {})[:name]
|
538
|
+
|
539
|
+
assert_equal "American Indian Heritage Day", (Holidays.on(Date.civil(2017, 11, 24), [:us_md])[0] || {})[:name]
|
540
|
+
assert_equal "American Indian Heritage Day", (Holidays.on(Date.civil(2018, 11, 23), [:us_md])[0] || {})[:name]
|
541
|
+
assert_equal "American Indian Heritage Day", (Holidays.on(Date.civil(2019, 11, 29), [:us_md])[0] || {})[:name]
|
542
|
+
|
543
|
+
assert_equal "Day after Thanksgiving (Black Friday)", (Holidays.on(Date.civil(2017, 11, 24), [:us_ca, :us_de, :us_fl, :us_ia, :us_il, :us_ks, :us_ky, :us_me, :us_mi, :us_mn, :us_ms, :us_ne, :us_nh, :us_nc, :us_pa, :us_sc, :us_ok, :us_tn, :us_tx, :us_va, :us_wa, :us_wv])[0] || {})[:name]
|
544
|
+
assert_equal "Day after Thanksgiving (Black Friday)", (Holidays.on(Date.civil(2018, 11, 23), [:us_ca, :us_de, :us_fl, :us_ia, :us_il, :us_ks, :us_ky, :us_me, :us_mi, :us_mn, :us_ms, :us_ne, :us_nh, :us_nc, :us_pa, :us_sc, :us_ok, :us_tn, :us_tx, :us_va, :us_wa, :us_wv])[0] || {})[:name]
|
545
|
+
assert_equal "Day after Thanksgiving (Black Friday)", (Holidays.on(Date.civil(2019, 11, 29), [:us_ca, :us_de, :us_fl, :us_ia, :us_il, :us_ks, :us_ky, :us_me, :us_mi, :us_mn, :us_ms, :us_ne, :us_nh, :us_nc, :us_pa, :us_sc, :us_ok, :us_tn, :us_tx, :us_va, :us_wa, :us_wv])[0] || {})[:name]
|
546
|
+
|
547
|
+
assert_equal "Christmas Eve (Holiday)", (Holidays.on(Date.civil(2022, 12, 23), [:us_mi, :us_sc, :us_va])[0] || {})[:name]
|
548
|
+
assert_equal "Christmas Eve (Holiday)", (Holidays.on(Date.civil(2023, 12, 22), [:us_mi, :us_sc, :us_va])[0] || {})[:name]
|
549
|
+
assert_equal "Christmas Eve (Holiday)", (Holidays.on(Date.civil(2028, 12, 22), [:us_mi, :us_sc, :us_va])[0] || {})[:name]
|
550
|
+
|
551
|
+
assert_equal "Christmas Eve", (Holidays.on(Date.civil(2017, 12, 24), [:us_ar, :us_mi, :us_nc, :us_va, :us_sc, :us_tx, :us_wi])[0] || {})[:name]
|
552
|
+
|
553
|
+
assert_nil (Holidays.on(Date.civil(2021, 12, 27), [:us])[0] || {})[:name]
|
554
|
+
assert_nil (Holidays.on(Date.civil(2022, 12, 26), [:us])[0] || {})[:name]
|
555
|
+
assert_nil (Holidays.on(Date.civil(2027, 12, 27), [:us])[0] || {})[:name]
|
556
|
+
|
557
|
+
assert_equal "Christmas Day", (Holidays.on(Date.civil(2021, 12, 27), [:us], [:observed])[0] || {})[:name]
|
558
|
+
assert_equal "Christmas Day", (Holidays.on(Date.civil(2022, 12, 26), [:us], [:observed])[0] || {})[:name]
|
559
|
+
assert_equal "Christmas Day", (Holidays.on(Date.civil(2027, 12, 27), [:us], [:observed])[0] || {})[:name]
|
560
|
+
|
561
|
+
assert_equal "Christmas Day", (Holidays.on(Date.civil(2017, 12, 25), [:us])[0] || {})[:name]
|
562
|
+
|
563
|
+
assert_equal "Day after Christmas", (Holidays.on(Date.civil(2017, 12, 26), [:us_ar, :us_nc, :us_ok, :us_sc, :us_tn, :us_tx])[0] || {})[:name]
|
564
|
+
|
565
|
+
assert_equal "New Year's Eve", (Holidays.on(Date.civil(2017, 12, 31), [:us_mi, :us_wi])[0] || {})[:name]
|
566
|
+
|
567
|
+
assert_equal "Groundhog Day", (Holidays.on(Date.civil(2013, 2, 2), [:us], [:informal])[0] || {})[:name]
|
568
|
+
|
569
|
+
assert_equal "Valentine's Day", (Holidays.on(Date.civil(2013, 2, 14), [:us], [:informal])[0] || {})[:name]
|
570
|
+
|
571
|
+
assert_equal "St. Patrick's Day", (Holidays.on(Date.civil(2013, 3, 17), [:us], [:informal])[0] || {})[:name]
|
572
|
+
|
573
|
+
assert_equal "April Fool's Day", (Holidays.on(Date.civil(2013, 4, 1), [:us], [:informal])[0] || {})[:name]
|
574
|
+
|
575
|
+
assert_equal "Earth Day", (Holidays.on(Date.civil(2013, 4, 22), [:us], [:informal])[0] || {})[:name]
|
576
|
+
|
577
|
+
assert_equal "Mother's Day", (Holidays.on(Date.civil(2013, 5, 12), [:us], [:informal])[0] || {})[:name]
|
578
|
+
|
579
|
+
assert_equal "Armed Forces Day", (Holidays.on(Date.civil(2013, 5, 18), [:us], [:informal])[0] || {})[:name]
|
580
|
+
|
581
|
+
assert_equal "Father's Day", (Holidays.on(Date.civil(2013, 6, 16), [:us], [:informal])[0] || {})[:name]
|
582
|
+
|
583
|
+
assert_equal "Halloween", (Holidays.on(Date.civil(2013, 10, 31), [:us], [:informal])[0] || {})[:name]
|
470
584
|
|
471
585
|
end
|
472
586
|
end
|