holidays 5.7.0 → 6.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (98) hide show
  1. checksums.yaml +4 -4
  2. data/.gitmodules +1 -1
  3. data/CHANGELOG.md +11 -0
  4. data/lib/generated_definitions/north_america.rb +1 -1
  5. data/lib/generated_definitions/tr.rb +1 -0
  6. data/lib/generated_definitions/us.rb +1 -1
  7. data/lib/holidays/definition/context/generator.rb +5 -36
  8. data/lib/holidays/definition/decorator/test.rb +37 -0
  9. data/lib/holidays/definition/entity/test.rb +11 -0
  10. data/lib/holidays/definition/generator/test.rb +51 -0
  11. data/lib/holidays/definition/parser/test.rb +86 -0
  12. data/lib/holidays/definition/validator/test.rb +71 -0
  13. data/lib/holidays/errors.rb +3 -0
  14. data/lib/holidays/factory/definition.rb +24 -0
  15. data/lib/holidays/version.rb +1 -1
  16. data/test/coverage_report.rb +1 -0
  17. data/test/data/test_custom_year_range_holiday_defs.yaml +7 -0
  18. data/test/data/test_multiple_custom_holiday_defs.yaml +7 -4
  19. data/test/data/test_single_custom_holiday_defs.yaml +7 -4
  20. data/test/data/test_single_custom_holiday_with_custom_procs.yaml +11 -7
  21. data/test/defs/test_defs_ar.rb +33 -19
  22. data/test/defs/test_defs_at.rb +14 -11
  23. data/test/defs/test_defs_au.rb +172 -141
  24. data/test/defs/test_defs_be_fr.rb +23 -14
  25. data/test/defs/test_defs_be_nl.rb +23 -14
  26. data/test/defs/test_defs_bg.rb +29 -17
  27. data/test/defs/test_defs_br.rb +33 -19
  28. data/test/defs/test_defs_ca.rb +175 -176
  29. data/test/defs/test_defs_ch.rb +29 -23
  30. data/test/defs/test_defs_cl.rb +49 -27
  31. data/test/defs/test_defs_cr.rb +17 -11
  32. data/test/defs/test_defs_cz.rb +25 -15
  33. data/test/defs/test_defs_de.rb +52 -61
  34. data/test/defs/test_defs_dk.rb +31 -19
  35. data/test/defs/test_defs_ecb_target.rb +14 -10
  36. data/test/defs/test_defs_ee.rb +28 -20
  37. data/test/defs/test_defs_el.rb +29 -17
  38. data/test/defs/test_defs_es.rb +114 -52
  39. data/test/defs/test_defs_europe.rb +1154 -715
  40. data/test/defs/test_defs_federal_reserve.rb +99 -57
  41. data/test/defs/test_defs_fedex.rb +19 -12
  42. data/test/defs/test_defs_fi.rb +47 -27
  43. data/test/defs/test_defs_fr.rb +29 -24
  44. data/test/defs/test_defs_gb.rb +90 -51
  45. data/test/defs/test_defs_ge.rb +40 -28
  46. data/test/defs/test_defs_hk.rb +47 -26
  47. data/test/defs/test_defs_hr.rb +32 -18
  48. data/test/defs/test_defs_hu.rb +26 -16
  49. data/test/defs/test_defs_ie.rb +41 -25
  50. data/test/defs/test_defs_is.rb +39 -22
  51. data/test/defs/test_defs_it.rb +23 -14
  52. data/test/defs/test_defs_jp.rb +112 -59
  53. data/test/defs/test_defs_kr.rb +25 -17
  54. data/test/defs/test_defs_li.rb +20 -20
  55. data/test/defs/test_defs_lt.rb +51 -30
  56. data/test/defs/test_defs_lu.rb +17 -12
  57. data/test/defs/test_defs_ma.rb +17 -11
  58. data/test/defs/test_defs_mt_en.rb +28 -19
  59. data/test/defs/test_defs_mt_mt.rb +28 -19
  60. data/test/defs/test_defs_mx.rb +33 -22
  61. data/test/defs/test_defs_my.rb +11 -8
  62. data/test/defs/test_defs_nerc.rb +17 -11
  63. data/test/defs/test_defs_nl.rb +21 -13
  64. data/test/defs/test_defs_no.rb +31 -18
  65. data/test/defs/test_defs_north_america.rb +507 -393
  66. data/test/defs/test_defs_nyse.rb +26 -15
  67. data/test/defs/test_defs_nz.rb +47 -28
  68. data/test/defs/test_defs_pe.rb +35 -20
  69. data/test/defs/test_defs_ph.rb +17 -11
  70. data/test/defs/test_defs_pl.rb +200 -119
  71. data/test/defs/test_defs_pt.rb +33 -24
  72. data/test/defs/test_defs_ro.rb +39 -24
  73. data/test/defs/test_defs_rs_cyrl.rb +33 -26
  74. data/test/defs/test_defs_rs_la.rb +33 -26
  75. data/test/defs/test_defs_ru.rb +22 -16
  76. data/test/defs/test_defs_scandinavia.rb +193 -116
  77. data/test/defs/test_defs_se.rb +47 -28
  78. data/test/defs/test_defs_sg.rb +13 -9
  79. data/test/defs/test_defs_si.rb +93 -24
  80. data/test/defs/test_defs_sk.rb +29 -17
  81. data/test/defs/test_defs_tn.rb +15 -10
  82. data/test/defs/test_defs_tr.rb +39 -30
  83. data/test/defs/test_defs_united_nations.rb +0 -1
  84. data/test/defs/test_defs_ups.rb +19 -12
  85. data/test/defs/test_defs_us.rb +333 -217
  86. data/test/defs/test_defs_ve.rb +23 -16
  87. data/test/defs/test_defs_vi.rb +10 -8
  88. data/test/defs/test_defs_za.rb +23 -14
  89. data/test/holidays/definition/context/test_generator.rb +40 -13
  90. data/test/holidays/definition/decorator/test_test.rb +123 -0
  91. data/test/holidays/definition/generator/test_test.rb +113 -0
  92. data/test/holidays/definition/parser/test_test.rb +142 -0
  93. data/test/holidays/definition/validator/test_region.rb +5 -0
  94. data/test/holidays/definition/validator/test_test.rb +60 -0
  95. metadata +15 -8
  96. data/test/holidays/factory/test_date_calculator.rb +0 -32
  97. data/test/holidays/factory/test_definition.rb +0 -62
  98. data/test/holidays/factory/test_finder.rb +0 -25
@@ -7,265 +7,381 @@ require File.expand_path(File.dirname(__FILE__)) + '/../test_helper'
7
7
  class UsDefinitionTests < Test::Unit::TestCase # :nodoc:
8
8
 
9
9
  def test_us
10
- [Date.civil(2017, 2, 28), Date.civil(2018, 2, 13), Date.civil(2019, 3, 5)].each do |date|
11
- assert_equal [], Holidays.on(date, [:us])
12
- assert_equal 'Shrove Tuesday', Holidays.on(date, [:us_fl])[0][:name]
13
- assert_equal 'Mardi Gras Day', Holidays.on(date, [:us_la])[0][:name]
14
- end
15
- 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}
16
- [Date.civil(2017, 4, 14), Date.civil(2018, 3, 30), Date.civil(2019, 4, 19)].each do |date|
17
- assert_equal [], Holidays.on(date, [:us])
18
- assert_equal 'Good Friday', Holidays.on(date, :us, :informal)[0][:name]
19
- assert_equal 'Good Friday', Holidays.on(date, states_good_friday)[0][:name]
20
- end
21
- [Date.civil(2017, 4, 16), Date.civil(2018, 4, 1), Date.civil(2019, 4, 21)].each do |date|
22
- assert_equal [], Holidays.on(date, [:us])
23
- assert_equal 'Easter Sunday', Holidays.on(date, :us, :informal)[0][:name]
24
- end
10
+ assert_equal "Shrove Tuesday", (Holidays.on(Date.civil(2017, 2, 28), [:us_fl])[0] || {})[:name]
11
+ assert_equal "Shrove Tuesday", (Holidays.on(Date.civil(2018, 2, 13), [:us_fl])[0] || {})[:name]
12
+ assert_equal "Shrove Tuesday", (Holidays.on(Date.civil(2019, 3, 5), [:us_fl])[0] || {})[:name]
25
13
 
26
- assert_equal "New Year's Day", Holidays.on(Date.civil(2017, 1, 1), [:us])[0][:name]
27
- assert_equal "New Year's Day", Holidays.on(Date.civil(2017, 1, 2), :observed, [:us])[0][:name]
14
+ assert_equal "Mardi Gras Day", (Holidays.on(Date.civil(2017, 2, 28), [:us_la])[0] || {})[:name]
15
+ assert_equal "Mardi Gras Day", (Holidays.on(Date.civil(2018, 2, 13), [:us_la])[0] || {})[:name]
16
+ assert_equal "Mardi Gras Day", (Holidays.on(Date.civil(2019, 3, 5), [:us_la])[0] || {})[:name]
28
17
 
29
- [Date.civil(2017, 1, 16), Date.civil(2018, 1, 15), Date.civil(2019, 1, 21)].each do |date|
30
- assert_equal 'Martin Luther King, Jr. Day', Holidays.on(date, [:us])[0][:name]
31
- end
32
- [Date.civil(2016, 1, 18), Date.civil(2017, 1, 16), Date.civil(2018, 1, 15)].each do |date|
33
- assert_equal 'Martin Luther King, Jr. Day', Holidays.on(date, [:us])[0][:name]
34
- assert_equal "Martin Luther King's and Robert E. Lee's Birthdays", Holidays.on(date, [:us_ms])[0][:name]
35
- end
36
- [Date.civil(2016, 1, 18), Date.civil(2017, 1, 16), Date.civil(2018, 1, 15)].each do |date|
37
- assert_equal 'Martin Luther King, Jr. Day', Holidays.on(date, [:us])[0][:name]
38
- assert_equal 'Idaho Human Rights Day', Holidays.on(date, [:us_id])[0][:name]
39
- end
40
- [Date.civil(2016, 1, 18), Date.civil(2017, 1, 16), Date.civil(2018, 1, 15)].each do |date|
41
- assert_equal 'Martin Luther King, Jr. Day', Holidays.on(date, [:us])[0][:name]
42
- assert_equal 'Civil Rights Day', Holidays.on(date, [:us_ar])[0][:name]
43
- end
18
+ assert_nil (Holidays.on(Date.civil(2017, 2, 28), [:us])[0] || {})[:name]
19
+ assert_nil (Holidays.on(Date.civil(2018, 2, 13), [:us])[0] || {})[:name]
20
+ assert_nil (Holidays.on(Date.civil(2019, 3, 5), [:us])[0] || {})[:name]
44
21
 
45
- states_inauguration = %i{us_tx us_dc us_la us_md us_va}
46
- [Date.civil(2017, 1, 20), Date.civil(2021, 1, 20)].each do |date|
47
- assert_equal [], Holidays.on(date, [:us])
48
- assert_equal 'Inauguration Day', Holidays.on(date, states_inauguration)[0][:name]
49
- end
50
- assert_equal 'Inauguration Day', Holidays.on(Date.civil(2025, 1, 20), states_inauguration)[1][:name]
22
+ 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]
23
+ 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]
24
+ 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]
51
25
 
52
- [Date.civil(2017, 1, 13), Date.civil(2018, 1, 12), Date.civil(2019, 1, 18)].each do |date|
53
- assert_equal [], Holidays.on(date, [:us])
54
- assert_equal 'Lee-Jackson Day', Holidays.on(date, [:us_va])[0][:name]
55
- end
26
+ assert_equal "Good Friday", (Holidays.on(Date.civil(2017, 4, 14), [:us], [:informal])[0] || {})[:name]
27
+ assert_equal "Good Friday", (Holidays.on(Date.civil(2018, 3, 30), [:us], [:informal])[0] || {})[:name]
28
+ assert_equal "Good Friday", (Holidays.on(Date.civil(2019, 4, 19), [:us], [:informal])[0] || {})[:name]
56
29
 
57
- assert_equal 'Confederate Heroes Day', Holidays.on(Date.civil(2017, 1, 19), [:us_tx])[0][:name]
30
+ assert_nil (Holidays.on(Date.civil(2017, 2, 28), [:us])[0] || {})[:name]
31
+ assert_nil (Holidays.on(Date.civil(2018, 2, 13), [:us])[0] || {})[:name]
32
+ assert_nil (Holidays.on(Date.civil(2019, 3, 5), [:us])[0] || {})[:name]
58
33
 
59
- [Date.civil(2008, 2, 18), Date.civil(2017, 2, 20), Date.civil(2018, 2, 19)].each do |date|
60
- assert_equal "Presidents' Day", Holidays.on(date, [:us])[0][:name]
61
- end
62
- [Date.civil(2017, 3, 6), Date.civil(2018, 3, 5), Date.civil(2019, 3, 4)].each do |date|
63
- assert_equal [], Holidays.on(date, [:us])
64
- assert_equal 'Casimir Pulaski Day', Holidays.on(date, [:us_il])[0][:name]
65
- end
66
- [Date.civil(2017, 3, 7), Date.civil(2018, 3, 6), Date.civil(2019, 3, 5)].each do |date|
67
- assert_equal [], Holidays.on(date, [:us])
68
- assert_equal 'Town Meeting Day', Holidays.on(date, [:us_vt])[0][:name]
69
- end
34
+ assert_nil (Holidays.on(Date.civil(2017, 4, 16), [:us])[0] || {})[:name]
35
+ assert_nil (Holidays.on(Date.civil(2018, 4, 1), [:us])[0] || {})[:name]
36
+ assert_nil (Holidays.on(Date.civil(2019, 4, 21), [:us])[0] || {})[:name]
70
37
 
71
- assert_equal 'Texas Independence Day', Holidays.on(Date.civil(2017, 3, 2), [:us_tx])[0][:name]
38
+ assert_equal "Easter Sunday", (Holidays.on(Date.civil(2017, 4, 16), [:us], [:informal])[0] || {})[:name]
39
+ assert_equal "Easter Sunday", (Holidays.on(Date.civil(2018, 4, 1), [:us], [:informal])[0] || {})[:name]
40
+ assert_equal "Easter Sunday", (Holidays.on(Date.civil(2019, 4, 21), [:us], [:informal])[0] || {})[:name]
72
41
 
73
- [Date.civil(2017, 3, 27), Date.civil(2018, 3, 26), Date.civil(2022, 3, 25)].each do |date|
74
- assert_equal [], Holidays.on(date, [:us])
75
- assert_equal 'Prince Jonah Kuhio Kalanianaole Day', Holidays.on(date, [:us_hi], :observed)[0][:name]
76
- end
77
- assert_equal [], Holidays.on(Date.civil(2017, 3, 26), [:us])
78
- assert_equal 'Prince Jonah Kuhio Kalanianaole Day', Holidays.on(Date.civil(2017, 3, 26), [:us_hi])[0][:name]
42
+ assert_equal "New Year's Day", (Holidays.on(Date.civil(2017, 1, 1), [:us])[0] || {})[:name]
79
43
 
80
- [Date.civil(2017, 3, 27), Date.civil(2018, 3, 26), Date.civil(2019, 3, 25)].each do |date|
81
- assert_equal [], Holidays.on(date, [:us])
82
- assert_equal "Seward's Day", Holidays.on(date, [:us_ak])[0][:name]
83
- end
44
+ assert_equal "New Year's Day", (Holidays.on(Date.civil(2017, 1, 2), [:us], [:observed])[0] || {})[:name]
84
45
 
85
- assert_equal 'César Chávez Day', Holidays.on(Date.civil(2017, 3, 31), [:us_ca])[0][:name]
46
+ assert_equal "Martin Luther King, Jr. Day", (Holidays.on(Date.civil(2017, 1, 16), [:us])[0] || {})[:name]
47
+ assert_equal "Martin Luther King, Jr. Day", (Holidays.on(Date.civil(2018, 1, 15), [:us])[0] || {})[:name]
48
+ assert_equal "Martin Luther King, Jr. Day", (Holidays.on(Date.civil(2019, 1, 21), [:us])[0] || {})[:name]
86
49
 
87
- [Date.civil(2023, 4, 17), Date.civil(2022, 4, 15), Date.civil(2028, 4, 17)].each do |date|
88
- assert_equal 'Emancipation Day', Holidays.on(date, [:us_dc, :us_ca], :observed)[0][:name]
89
- end
90
- assert_equal 'Emancipation Day', Holidays.on(Date.civil(2017, 4, 16), [:us_dc, :us_ca])[0][:name]
50
+ assert_equal "Martin Luther King, Jr. Day", (Holidays.on(Date.civil(2016, 1, 18), [:us])[0] || {})[:name]
51
+ assert_equal "Martin Luther King, Jr. Day", (Holidays.on(Date.civil(2017, 1, 16), [:us])[0] || {})[:name]
52
+ assert_equal "Martin Luther King, Jr. Day", (Holidays.on(Date.civil(2018, 1, 15), [:us])[0] || {})[:name]
91
53
 
92
- [Date.civil(2017, 4, 17), Date.civil(2018, 4, 16), Date.civil(2019, 4, 15)].each do |date|
93
- assert_equal [], Holidays.on(date, [:us])
94
- assert_equal "Patriots' Day", Holidays.on(date, [:us_me, :us_ma])[0][:name]
95
- end
54
+ assert_equal "Martin Luther King's and Robert E. Lee's Birthdays", (Holidays.on(Date.civil(2016, 1, 18), [:us_ms])[0] || {})[:name]
55
+ assert_equal "Martin Luther King's and Robert E. Lee's Birthdays", (Holidays.on(Date.civil(2017, 1, 16), [:us_ms])[0] || {})[:name]
56
+ assert_equal "Martin Luther King's and Robert E. Lee's Birthdays", (Holidays.on(Date.civil(2018, 1, 15), [:us_ms])[0] || {})[:name]
96
57
 
97
- assert_equal 'San Jacinto Day', Holidays.on(Date.civil(2017, 4, 21), [:us_tx])[0][:name]
58
+ assert_equal "Idaho Human Rights Day", (Holidays.on(Date.civil(2016, 1, 18), [:us_id])[0] || {})[:name]
59
+ assert_equal "Idaho Human Rights Day", (Holidays.on(Date.civil(2017, 1, 16), [:us_id])[0] || {})[:name]
60
+ assert_equal "Idaho Human Rights Day", (Holidays.on(Date.civil(2018, 1, 15), [:us_id])[0] || {})[:name]
98
61
 
99
- [Date.civil(2017, 4, 24), Date.civil(2018, 4, 30), Date.civil(2019, 4, 29)].each do |date|
100
- assert_equal [], Holidays.on(date, [:us])
101
- assert_equal 'Confederate Memorial Day', Holidays.on(date, [:us_al, :us_ms])[0][:name]
102
- end
103
- [Date.civil(2015, 4, 27), Date.civil(2020, 4, 27), Date.civil(2026, 4, 27)].each do |date|
104
- assert_equal [], Holidays.on(Date.civil(2020, 4, 27), [:us])
105
- assert_equal 'Confederate Memorial Day', Holidays.on(Date.civil(2020, 4, 27), [:us_fl], :observed)[0][:name]
106
- end
107
- assert_equal [], Holidays.on(Date.civil(2017, 4, 26), [:us])
108
- assert_equal 'Confederate Memorial Day', Holidays.on(Date.civil(2017, 4, 26), [:us_fl])[0][:name]
62
+ assert_equal "Civil Rights Day", (Holidays.on(Date.civil(2016, 1, 18), [:us_ar])[0] || {})[:name]
63
+ assert_equal "Civil Rights Day", (Holidays.on(Date.civil(2017, 1, 16), [:us_ar])[0] || {})[:name]
64
+ assert_equal "Civil Rights Day", (Holidays.on(Date.civil(2018, 1, 15), [:us_ar])[0] || {})[:name]
109
65
 
110
- [Date.civil(2015, 4, 20), Date.civil(2021, 4, 26)].each do |date|
111
- assert_equal [], Holidays.on(Date.civil(2015, 4, 20), [:us])
112
- assert_equal 'State Holiday', Holidays.on(date, [:us_ga])[0][:name]
113
- end
66
+ assert_nil (Holidays.on(Date.civil(2017, 1, 20), [:us])[0] || {})[:name]
67
+ assert_nil (Holidays.on(Date.civil(2021, 1, 20), [:us])[0] || {})[:name]
114
68
 
115
- assert_equal 'Arbor Day', Holidays.on(Date.civil(2017, 4, 28), [:us_ne])[0][:name]
116
- assert_equal 'Truman Day', Holidays.on(Date.civil(2017, 5, 8), [:us_mo])[0][:name]
117
- assert_equal 'Confederate Memorial Day', Holidays.on(Date.civil(2017, 5, 10), [:us_sc])[0][:name]
69
+ assert_equal "Inauguration Day", (Holidays.on(Date.civil(2017, 1, 20), [:us_tx, :us_dc, :us_la, :us_md, :us_va])[0] || {})[:name]
70
+ assert_equal "Inauguration Day", (Holidays.on(Date.civil(2021, 1, 20), [:us_tx, :us_dc, :us_la, :us_md, :us_va])[0] || {})[:name]
118
71
 
119
- [Date.civil(2017, 5, 29), Date.civil(2018, 5, 28), Date.civil(2019, 5, 27)].each do |date|
120
- assert_equal 'Memorial Day', Holidays.on(date, [:us])[0][:name]
121
- end
72
+ assert_nil (Holidays.on(Date.civil(2017, 1, 13), [:us])[0] || {})[:name]
73
+ assert_nil (Holidays.on(Date.civil(2018, 1, 12), [:us])[0] || {})[:name]
74
+ assert_nil (Holidays.on(Date.civil(2019, 1, 18), [:us])[0] || {})[:name]
122
75
 
123
- [Date.civil(2017, 6, 5), Date.civil(2018, 6, 4), Date.civil(2019, 6, 3)].each do |date|
124
- assert_equal [], Holidays.on(date, [:us])
125
- assert_equal "Jefferson Davis' Birthday", Holidays.on(date, [:us_al])[0][:name]
126
- end
127
- assert_equal 'Birthday of Jefferson Davis', Holidays.on(Date.civil(2017, 6, 3), [:us_fl])[0][:name]
76
+ assert_equal "Lee-Jackson Day", (Holidays.on(Date.civil(2017, 1, 13), [:us_va])[0] || {})[:name]
77
+ assert_equal "Lee-Jackson Day", (Holidays.on(Date.civil(2018, 1, 12), [:us_va])[0] || {})[:name]
78
+ assert_equal "Lee-Jackson Day", (Holidays.on(Date.civil(2019, 1, 18), [:us_va])[0] || {})[:name]
128
79
 
129
- [Date.civil(2017, 6, 12), Date.civil(2018, 6, 11), Date.civil(2022, 6, 10)].each do |date|
130
- assert_equal [], Holidays.on(date, [:us])
131
- assert_equal 'King Kamehameha I Day', Holidays.on(date, [:us_hi], :observed)[0][:name]
132
- end
133
- assert_equal [], Holidays.on(Date.civil(2017, 6, 11), [:us])
134
- assert_equal 'King Kamehameha I Day', Holidays.on(Date.civil(2017, 6, 11), [:us_hi])[0][:name]
80
+ assert_equal "Confederate Heroes Day", (Holidays.on(Date.civil(2017, 1, 19), [:us_tx])[0] || {})[:name]
135
81
 
136
- assert_equal 'Emancipation Day in Texas', Holidays.on(Date.civil(2017, 6, 19), [:us_tx])[0][:name]
82
+ assert_equal "Presidents' Day", (Holidays.on(Date.civil(2008, 2, 18), [:us])[0] || {})[:name]
83
+ assert_equal "Presidents' Day", (Holidays.on(Date.civil(2017, 2, 20), [:us])[0] || {})[:name]
84
+ assert_equal "Presidents' Day", (Holidays.on(Date.civil(2018, 2, 19), [:us])[0] || {})[:name]
137
85
 
138
- [Date.civil(2017, 6, 20), Date.civil(2020, 6, 19), Date.civil(2021, 6, 21)].each do |date|
139
- assert_equal [], Holidays.on(date, [:us])
140
- assert_equal 'West Virginia Day', Holidays.on(date, [:us_wv], :observed)[0][:name]
141
- end
142
- assert_equal [], Holidays.on(Date.civil(2017, 6, 20), [:us])
143
- assert_equal 'West Virginia Day', Holidays.on(Date.civil(2017, 6, 20), [:us_wv])[0][:name]
86
+ assert_nil (Holidays.on(Date.civil(2017, 3, 6), [:us])[0] || {})[:name]
87
+ assert_nil (Holidays.on(Date.civil(2018, 3, 5), [:us])[0] || {})[:name]
88
+ assert_nil (Holidays.on(Date.civil(2019, 3, 4), [:us])[0] || {})[:name]
144
89
 
145
- assert_equal 'Emancipation Day', Holidays.on(Date.civil(2017, 7, 3), [:us_vi])[0][:name]
90
+ assert_equal "Casimir Pulaski Day", (Holidays.on(Date.civil(2017, 3, 6), [:us_il])[0] || {})[:name]
91
+ assert_equal "Casimir Pulaski Day", (Holidays.on(Date.civil(2018, 3, 5), [:us_il])[0] || {})[:name]
92
+ assert_equal "Casimir Pulaski Day", (Holidays.on(Date.civil(2019, 3, 4), [:us_il])[0] || {})[:name]
146
93
 
147
- [Date.civil(2020, 7, 4), Date.civil(2021, 7, 4), Date.civil(2026, 7, 4)].each do |date|
148
- assert_equal 'Independence Day', Holidays.on(date, [:us])[0][:name]
149
- assert_equal 'Independence Day', Holidays.on(date, [:us_va])[0][:name]
150
- end
151
- [Date.civil(2020, 7, 3), Date.civil(2021, 7, 5), Date.civil(2026, 7, 3)].each do |date|
152
- assert_equal [], Holidays.on(date, [:us])
153
- assert_equal 'Independence Day (Holiday)', Holidays.on(date, [:us_va])[0][:name]
154
- end
94
+ assert_nil (Holidays.on(Date.civil(2017, 3, 7), [:us])[0] || {})[:name]
95
+ assert_nil (Holidays.on(Date.civil(2018, 3, 6), [:us])[0] || {})[:name]
96
+ assert_nil (Holidays.on(Date.civil(2019, 3, 5), [:us])[0] || {})[:name]
155
97
 
156
- assert_equal 'Pioneer Day', Holidays.on(Date.civil(2017, 7, 24), [:us_ut])[0][:name]
98
+ assert_equal "Town Meeting Day", (Holidays.on(Date.civil(2017, 3, 7), [:us_vt])[0] || {})[:name]
99
+ assert_equal "Town Meeting Day", (Holidays.on(Date.civil(2018, 3, 6), [:us_vt])[0] || {})[:name]
100
+ assert_equal "Town Meeting Day", (Holidays.on(Date.civil(2019, 3, 5), [:us_vt])[0] || {})[:name]
157
101
 
158
- [Date.civil(2017, 8, 14), Date.civil(2020, 8, 10), Date.civil(2021, 8, 9)].each do |date|
159
- assert_equal [], Holidays.on(date, [:us])
160
- assert_equal 'Victory Day', Holidays.on(date, [:us_ri])[0][:name]
161
- end
102
+ assert_equal "Texas Independence Day", (Holidays.on(Date.civil(2017, 3, 2), [:us_tx])[0] || {})[:name]
162
103
 
163
- [Date.civil(2017, 8, 16), Date.civil(2020, 8, 17), Date.civil(2025, 8, 15)].each do |date|
164
- assert_equal [], Holidays.on(date, [:us])
165
- assert_equal 'Bennington Battle Day', Holidays.on(date, [:us_vt], :observed)[0][:name]
166
- end
167
- assert_equal [], Holidays.on(Date.civil(2017, 8, 16), [:us])
168
- assert_equal 'Bennington Battle Day', Holidays.on(Date.civil(2017, 8, 16), [:us_vt])[0][:name]
104
+ assert_nil (Holidays.on(Date.civil(2017, 3, 27), [:us], [:observed])[0] || {})[:name]
105
+ assert_nil (Holidays.on(Date.civil(2018, 3, 26), [:us], [:observed])[0] || {})[:name]
106
+ assert_nil (Holidays.on(Date.civil(2022, 3, 25), [:us], [:observed])[0] || {})[:name]
169
107
 
170
- [Date.civil(2017, 8, 18), Date.civil(2020, 8, 21), Date.civil(2025, 8, 15)].each do |date|
171
- assert_equal [], Holidays.on(date, [:us])
172
- assert_equal 'Statehood Day', Holidays.on(date, [:us_hi])[0][:name]
173
- end
108
+ assert_equal "Prince Jonah Kuhio Kalanianaole Day", (Holidays.on(Date.civil(2017, 3, 27), [:us_hi], [:observed])[0] || {})[:name]
109
+ assert_equal "Prince Jonah Kuhio Kalanianaole Day", (Holidays.on(Date.civil(2018, 3, 26), [:us_hi], [:observed])[0] || {})[:name]
110
+ assert_equal "Prince Jonah Kuhio Kalanianaole Day", (Holidays.on(Date.civil(2022, 3, 25), [:us_hi], [:observed])[0] || {})[:name]
174
111
 
175
- assert_equal 'Lyndon Baines Johnson Day', Holidays.on(Date.civil(2017, 8, 27), [:us_tx])[0][:name]
112
+ assert_nil (Holidays.on(Date.civil(2017, 3, 26), [:us])[0] || {})[:name]
176
113
 
177
- [Date.civil(2017, 9, 4), Date.civil(2018, 9, 3), Date.civil(2019, 9, 2)].each do |date|
178
- assert_equal 'Labor Day', Holidays.on(date, [:us])[0][:name]
179
- end
180
- [Date.civil(2017, 9, 21), Date.civil(2018, 9, 10), Date.civil(2019, 9, 30)].each do |date|
181
- assert_equal [], Holidays.on(date, [:us])
182
- assert_equal 'Rosh Hashanah', Holidays.on(date, [:us_tx])[0][:name]
183
- end
184
- [Date.civil(2017, 9, 30), Date.civil(2018, 9, 19), Date.civil(2019, 10, 9)].each do |date|
185
- assert_equal [], Holidays.on(date, [:us])
186
- assert_equal 'Yom Kippur', Holidays.on(date, [:us_tx])[0][:name]
187
- end
114
+ assert_equal "Prince Jonah Kuhio Kalanianaole Day", (Holidays.on(Date.civil(2017, 3, 26), [:us_hi])[0] || {})[:name]
188
115
 
189
- states_columbus_day_formal =
190
- %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
191
- us_nj us_nm us_ny us_oh us_pa us_ri us_ut us_va us_wv}
192
- states_columbus_day_informal =
193
- %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}
194
-
195
- [Date.civil(2017, 10, 9), Date.civil(2018, 10, 8), Date.civil(2019, 10, 14)].each do |date|
196
- assert_equal [], Holidays.on(date, [:us])
197
- assert_equal [], Holidays.on(date, states_columbus_day_informal)
198
- assert_equal 'Columbus Day', Holidays.on(date, states_columbus_day_formal)[0][:name]
199
- assert_equal 'Columbus Day', Holidays.on(date, states_columbus_day_informal, :informal)[0][:name]
200
- end
116
+ assert_nil (Holidays.on(Date.civil(2017, 3, 27), [:us])[0] || {})[:name]
117
+ assert_nil (Holidays.on(Date.civil(2018, 3, 26), [:us])[0] || {})[:name]
118
+ assert_nil (Holidays.on(Date.civil(2019, 3, 25), [:us])[0] || {})[:name]
201
119
 
202
- assert_equal 'Alaska Day', Holidays.on(Date.civil(2017, 10, 18), [:us_ak])[0][:name]
120
+ assert_equal "Seward's Day", (Holidays.on(Date.civil(2017, 3, 27), [:us_ak])[0] || {})[:name]
121
+ assert_equal "Seward's Day", (Holidays.on(Date.civil(2018, 3, 26), [:us_ak])[0] || {})[:name]
122
+ assert_equal "Seward's Day", (Holidays.on(Date.civil(2019, 3, 25), [:us_ak])[0] || {})[:name]
203
123
 
204
- [Date.civil(2017, 10, 27), Date.civil(2018, 10, 26), Date.civil(2019, 10, 25)].each do |date|
205
- assert_equal [], Holidays.on(date, [:us])
206
- assert_equal 'Nevada Day', Holidays.on(date, :us_nv)[0][:name]
207
- end
124
+ assert_equal "César Chávez Day", (Holidays.on(Date.civil(2017, 3, 31), [:us_ca])[0] || {})[:name]
208
125
 
209
- states_election_day = %i{us_de us_hi us_il us_in us_mt us_nj us_ny us_pa us_ri}
210
- [Date.civil(2017, 11, 7), Date.civil(2018, 11, 6), Date.civil(2021, 11, 2)].each do |date|
211
- assert_equal [], Holidays.on(date, [:us])
212
- assert_equal 'Election Day', Holidays.on(date, states_election_day)[0][:name]
213
- end
126
+ assert_equal "Emancipation Day", (Holidays.on(Date.civil(2023, 4, 17), [:us_dc, :us_ca], [:observed])[0] || {})[:name]
127
+ assert_equal "Emancipation Day", (Holidays.on(Date.civil(2022, 4, 15), [:us_dc, :us_ca], [:observed])[0] || {})[:name]
128
+ assert_equal "Emancipation Day", (Holidays.on(Date.civil(2028, 4, 17), [:us_dc, :us_ca], [:observed])[0] || {})[:name]
214
129
 
215
- [Date.civil(2017, 11, 10), Date.civil(2018, 11, 12), Date.civil(2019, 11, 11)].each do |date|
216
- assert_equal 'Veterans Day', Holidays.on(date, [:us], :observed)[0][:name]
217
- end
218
- assert_equal 'Veterans Day', Holidays.on(Date.civil(2017, 11, 11), [:us])[0][:name]
130
+ assert_equal "Emancipation Day", (Holidays.on(Date.civil(2017, 4, 16), [:us_dc, :us_ca])[0] || {})[:name]
219
131
 
220
- [Date.civil(2017, 11, 23), Date.civil(2018, 11, 22), Date.civil(2019, 11, 28)].each do |date|
221
- assert_equal 'Thanksgiving', Holidays.on(date, [:us])[0][:name]
222
- end
132
+ assert_nil (Holidays.on(Date.civil(2017, 4, 17), [:us])[0] || {})[:name]
133
+ assert_nil (Holidays.on(Date.civil(2018, 4, 16), [:us])[0] || {})[:name]
134
+ assert_nil (Holidays.on(Date.civil(2019, 4, 15), [:us])[0] || {})[:name]
223
135
 
224
- states_black_friday =
225
- %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
226
- us_sc us_ok us_tn us_tx us_va us_wa us_wv}
227
-
228
- [Date.civil(2017, 11, 24), Date.civil(2018, 11, 23), Date.civil(2019, 11, 29)].each do |date|
229
- assert_equal [], Holidays.on(date, [:us])
230
- assert_equal 'Family Day', Holidays.on(date, [:us_nv])[0][:name]
231
- assert_equal 'State Holiday', Holidays.on(date, [:us_ga])[0][:name]
232
- assert_equal "Presidents' Day", Holidays.on(date, [:us_nm])[0][:name]
233
- assert_equal "Lincoln's Birthday", Holidays.on(date, [:us_in])[0][:name]
234
- assert_equal 'American Indian Heritage Day', Holidays.on(date, [:us_md])[0][:name]
235
- assert_equal 'Day after Thanksgiving (Black Friday)', Holidays.on(date, states_black_friday)[0][:name]
236
- end
136
+ assert_equal "Patriots' Day", (Holidays.on(Date.civil(2017, 4, 17), [:us_me, :us_ma])[0] || {})[:name]
137
+ assert_equal "Patriots' Day", (Holidays.on(Date.civil(2018, 4, 16), [:us_me, :us_ma])[0] || {})[:name]
138
+ assert_equal "Patriots' Day", (Holidays.on(Date.civil(2019, 4, 15), [:us_me, :us_ma])[0] || {})[:name]
237
139
 
238
- states_xmas_eve = %i{us_ar us_mi us_nc us_sc us_tx us_wi}
239
- states_xmas_eve_holiday = %i{us_mi us_sc us_va}
240
- [Date.civil(2022, 12, 23), Date.civil(2023, 12, 22), Date.civil(2028, 12, 22)].each do |date|
241
- assert_equal 'Christmas Eve (Holiday)', Holidays.on(date, states_xmas_eve_holiday)[0][:name]
242
- end
243
- assert_equal 'Christmas Eve', Holidays.on(Date.civil(2017, 12, 24), states_xmas_eve)[0][:name]
244
- assert_equal 'Christmas Eve', Holidays.on(Date.civil(2017, 12, 24), states_xmas_eve_holiday)[0][:name]
140
+ assert_equal "San Jacinto Day", (Holidays.on(Date.civil(2017, 4, 21), [:us_tx])[0] || {})[:name]
245
141
 
246
- [Date.civil(2021, 12, 27), Date.civil(2022, 12, 26), Date.civil(2027, 12, 27)].each do |date|
247
- assert_equal [], Holidays.on(date, [:us])
248
- assert_equal 'Christmas Day', Holidays.on(date, [:us], :observed)[0][:name]
249
- end
250
- assert_equal 'Christmas Day', Holidays.on(Date.civil(2017, 12, 25), [:us])[0][:name]
142
+ assert_nil (Holidays.on(Date.civil(2017, 4, 24), [:us])[0] || {})[:name]
143
+ assert_nil (Holidays.on(Date.civil(2018, 4, 30), [:us])[0] || {})[:name]
144
+ assert_nil (Holidays.on(Date.civil(2019, 4, 29), [:us])[0] || {})[:name]
251
145
 
252
- states_day_after_christmas = %i{us_ar us_nc us_ok us_sc us_tn us_tx}
253
- assert_equal 'Day after Christmas', Holidays.on(Date.civil(2017, 12, 26), states_day_after_christmas)[0][:name]
146
+ assert_equal "Confederate Memorial Day", (Holidays.on(Date.civil(2017, 4, 24), [:us_al, :us_ms])[0] || {})[:name]
147
+ assert_equal "Confederate Memorial Day", (Holidays.on(Date.civil(2018, 4, 30), [:us_al, :us_ms])[0] || {})[:name]
148
+ assert_equal "Confederate Memorial Day", (Holidays.on(Date.civil(2019, 4, 29), [:us_al, :us_ms])[0] || {})[:name]
254
149
 
255
- assert_equal "New Year's Eve", Holidays.on(Date.civil(2017, 12, 31), [:us_mi, :us_wi])[0][:name]
150
+ assert_nil (Holidays.on(Date.civil(2015, 4, 27), [:us])[0] || {})[:name]
151
+ assert_nil (Holidays.on(Date.civil(2020, 4, 27), [:us])[0] || {})[:name]
152
+ assert_nil (Holidays.on(Date.civil(2026, 4, 27), [:us])[0] || {})[:name]
256
153
 
154
+ assert_equal "Confederate Memorial Day", (Holidays.on(Date.civil(2015, 4, 27), [:us_fl], [:observed])[0] || {})[:name]
155
+ assert_equal "Confederate Memorial Day", (Holidays.on(Date.civil(2020, 4, 27), [:us_fl], [:observed])[0] || {})[:name]
156
+ assert_equal "Confederate Memorial Day", (Holidays.on(Date.civil(2026, 4, 27), [:us_fl], [:observed])[0] || {})[:name]
257
157
 
258
- {Date.civil(2013,2,2) => 'Groundhog Day',
259
- Date.civil(2013,2,14) => 'Valentine\'s Day',
260
- Date.civil(2013,3,17) => 'St. Patrick\'s Day',
261
- Date.civil(2013,4,1) => 'April Fool\'s Day',
262
- Date.civil(2013,4,22) => 'Earth Day',
263
- Date.civil(2013,5,12) => 'Mother\'s Day',
264
- Date.civil(2013,5,18) => 'Armed Forces Day',
265
- Date.civil(2013,6,16) => 'Father\'s Day',
266
- Date.civil(2013,10,31) => 'Halloween'}.each do |date, name|
267
- assert_equal name, (Holidays.on(date, :us, :informal)[0] || {})[:name]
268
- end
158
+ assert_nil (Holidays.on(Date.civil(2017, 4, 26), [:us])[0] || {})[:name]
159
+
160
+ assert_equal "Confederate Memorial Day", (Holidays.on(Date.civil(2017, 4, 26), [:us_fl])[0] || {})[:name]
161
+
162
+ assert_nil (Holidays.on(Date.civil(2015, 4, 20), [:us])[0] || {})[:name]
163
+ assert_nil (Holidays.on(Date.civil(2021, 4, 26), [:us])[0] || {})[:name]
164
+
165
+ assert_equal "State Holiday", (Holidays.on(Date.civil(2015, 4, 20), [:us_ga])[0] || {})[:name]
166
+ assert_equal "State Holiday", (Holidays.on(Date.civil(2021, 4, 26), [:us_ga])[0] || {})[:name]
167
+
168
+ assert_equal "Arbor Day", (Holidays.on(Date.civil(2017, 4, 28), [:us_ne])[0] || {})[:name]
169
+
170
+ assert_equal "Truman Day", (Holidays.on(Date.civil(2017, 5, 8), [:us_mo])[0] || {})[:name]
171
+
172
+ assert_equal "Confederate Memorial Day", (Holidays.on(Date.civil(2017, 5, 10), [:us_sc])[0] || {})[:name]
173
+
174
+ assert_equal "Memorial Day", (Holidays.on(Date.civil(2017, 5, 29), [:us])[0] || {})[:name]
175
+ assert_equal "Memorial Day", (Holidays.on(Date.civil(2018, 5, 28), [:us])[0] || {})[:name]
176
+ assert_equal "Memorial Day", (Holidays.on(Date.civil(2019, 5, 27), [:us])[0] || {})[:name]
177
+
178
+ assert_nil (Holidays.on(Date.civil(2017, 6, 5), [:us])[0] || {})[:name]
179
+ assert_nil (Holidays.on(Date.civil(2018, 6, 4), [:us])[0] || {})[:name]
180
+ assert_nil (Holidays.on(Date.civil(2019, 6, 3), [:us])[0] || {})[:name]
181
+
182
+ assert_equal "Jefferson Davis' Birthday", (Holidays.on(Date.civil(2017, 6, 5), [:us_al])[0] || {})[:name]
183
+ assert_equal "Jefferson Davis' Birthday", (Holidays.on(Date.civil(2018, 6, 4), [:us_al])[0] || {})[:name]
184
+ assert_equal "Jefferson Davis' Birthday", (Holidays.on(Date.civil(2019, 6, 3), [:us_al])[0] || {})[:name]
185
+
186
+ assert_equal "Birthday of Jefferson Davis", (Holidays.on(Date.civil(2017, 6, 3), [:us_fl])[0] || {})[:name]
187
+
188
+ assert_nil (Holidays.on(Date.civil(2017, 6, 12), [:us])[0] || {})[:name]
189
+ assert_nil (Holidays.on(Date.civil(2018, 6, 11), [:us])[0] || {})[:name]
190
+ assert_nil (Holidays.on(Date.civil(2022, 6, 10), [:us])[0] || {})[:name]
191
+
192
+ assert_equal "King Kamehameha I Day", (Holidays.on(Date.civil(2017, 6, 12), [:us_hi], [:observed])[0] || {})[:name]
193
+ assert_equal "King Kamehameha I Day", (Holidays.on(Date.civil(2018, 6, 11), [:us_hi], [:observed])[0] || {})[:name]
194
+ assert_equal "King Kamehameha I Day", (Holidays.on(Date.civil(2022, 6, 10), [:us_hi], [:observed])[0] || {})[:name]
195
+
196
+ assert_nil (Holidays.on(Date.civil(2017, 6, 11), [:us])[0] || {})[:name]
197
+
198
+ assert_equal "King Kamehameha I Day", (Holidays.on(Date.civil(2017, 6, 11), [:us_hi])[0] || {})[:name]
199
+
200
+ assert_equal "Emancipation Day in Texas", (Holidays.on(Date.civil(2017, 6, 19), [:us_tx])[0] || {})[:name]
201
+
202
+ assert_nil (Holidays.on(Date.civil(2017, 6, 20), [:us])[0] || {})[:name]
203
+ assert_nil (Holidays.on(Date.civil(2020, 6, 19), [:us])[0] || {})[:name]
204
+ assert_nil (Holidays.on(Date.civil(2021, 6, 21), [:us])[0] || {})[:name]
205
+
206
+ assert_equal "West Virginia Day", (Holidays.on(Date.civil(2017, 6, 20), [:us_wv], [:observed])[0] || {})[:name]
207
+ assert_equal "West Virginia Day", (Holidays.on(Date.civil(2020, 6, 19), [:us_wv], [:observed])[0] || {})[:name]
208
+ assert_equal "West Virginia Day", (Holidays.on(Date.civil(2021, 6, 21), [:us_wv], [:observed])[0] || {})[:name]
209
+
210
+ assert_equal "West Virginia Day", (Holidays.on(Date.civil(2017, 6, 20), [:us_wv])[0] || {})[:name]
211
+
212
+ assert_equal "Emancipation Day", (Holidays.on(Date.civil(2017, 7, 3), [:us_vi])[0] || {})[:name]
213
+
214
+ assert_equal "Independence Day", (Holidays.on(Date.civil(2020, 7, 4), [:us, :us_va])[0] || {})[:name]
215
+ assert_equal "Independence Day", (Holidays.on(Date.civil(2021, 7, 4), [:us, :us_va])[0] || {})[:name]
216
+ assert_equal "Independence Day", (Holidays.on(Date.civil(2026, 7, 4), [:us, :us_va])[0] || {})[:name]
217
+
218
+ assert_nil (Holidays.on(Date.civil(2020, 7, 3), [:us])[0] || {})[:name]
219
+ assert_nil (Holidays.on(Date.civil(2021, 7, 5), [:us])[0] || {})[:name]
220
+ assert_nil (Holidays.on(Date.civil(2026, 7, 3), [:us])[0] || {})[:name]
221
+
222
+ assert_equal "Independence Day (Holiday)", (Holidays.on(Date.civil(2020, 7, 3), [:us_va])[0] || {})[:name]
223
+ assert_equal "Independence Day (Holiday)", (Holidays.on(Date.civil(2021, 7, 5), [:us_va])[0] || {})[:name]
224
+ assert_equal "Independence Day (Holiday)", (Holidays.on(Date.civil(2026, 7, 3), [:us_va])[0] || {})[:name]
225
+
226
+ assert_equal "Pioneer Day", (Holidays.on(Date.civil(2020, 7, 24), [:us_ut])[0] || {})[:name]
227
+
228
+ assert_nil (Holidays.on(Date.civil(2017, 8, 14), [:us])[0] || {})[:name]
229
+ assert_nil (Holidays.on(Date.civil(2020, 8, 10), [:us])[0] || {})[:name]
230
+ assert_nil (Holidays.on(Date.civil(2021, 8, 9), [:us])[0] || {})[:name]
231
+
232
+ assert_equal "Victory Day", (Holidays.on(Date.civil(2017, 8, 14), [:us_ri])[0] || {})[:name]
233
+ assert_equal "Victory Day", (Holidays.on(Date.civil(2020, 8, 10), [:us_ri])[0] || {})[:name]
234
+ assert_equal "Victory Day", (Holidays.on(Date.civil(2021, 8, 9), [:us_ri])[0] || {})[:name]
235
+
236
+ assert_nil (Holidays.on(Date.civil(2017, 8, 16), [:us])[0] || {})[:name]
237
+ assert_nil (Holidays.on(Date.civil(2020, 8, 17), [:us])[0] || {})[:name]
238
+ assert_nil (Holidays.on(Date.civil(2025, 8, 15), [:us])[0] || {})[:name]
239
+
240
+ assert_equal "Bennington Battle Day", (Holidays.on(Date.civil(2017, 8, 16), [:us_vt], [:observed])[0] || {})[:name]
241
+ assert_equal "Bennington Battle Day", (Holidays.on(Date.civil(2020, 8, 17), [:us_vt], [:observed])[0] || {})[:name]
242
+ assert_equal "Bennington Battle Day", (Holidays.on(Date.civil(2025, 8, 15), [:us_vt], [:observed])[0] || {})[:name]
243
+
244
+ assert_equal "Bennington Battle Day", (Holidays.on(Date.civil(2017, 8, 16), [:us_vt])[0] || {})[:name]
245
+
246
+ assert_nil (Holidays.on(Date.civil(2017, 8, 18), [:us])[0] || {})[:name]
247
+ assert_nil (Holidays.on(Date.civil(2020, 8, 21), [:us])[0] || {})[:name]
248
+ assert_nil (Holidays.on(Date.civil(2025, 8, 15), [:us])[0] || {})[:name]
249
+
250
+ assert_equal "Statehood Day", (Holidays.on(Date.civil(2017, 8, 18), [:us_hi])[0] || {})[:name]
251
+ assert_equal "Statehood Day", (Holidays.on(Date.civil(2020, 8, 21), [:us_hi])[0] || {})[:name]
252
+ assert_equal "Statehood Day", (Holidays.on(Date.civil(2025, 8, 15), [:us_hi])[0] || {})[:name]
253
+
254
+ assert_equal "Lyndon Baines Johnson Day", (Holidays.on(Date.civil(2017, 8, 27), [:us_tx])[0] || {})[:name]
255
+
256
+ assert_equal "Labor Day", (Holidays.on(Date.civil(2017, 9, 4), [:us])[0] || {})[:name]
257
+ assert_equal "Labor Day", (Holidays.on(Date.civil(2018, 9, 3), [:us])[0] || {})[:name]
258
+ assert_equal "Labor Day", (Holidays.on(Date.civil(2019, 9, 2), [:us])[0] || {})[:name]
259
+
260
+ assert_nil (Holidays.on(Date.civil(2017, 9, 21), [:us])[0] || {})[:name]
261
+ assert_nil (Holidays.on(Date.civil(2018, 9, 10), [:us])[0] || {})[:name]
262
+ assert_nil (Holidays.on(Date.civil(2019, 9, 30), [:us])[0] || {})[:name]
263
+
264
+ assert_equal "Rosh Hashanah", (Holidays.on(Date.civil(2017, 9, 21), [:us_tx])[0] || {})[:name]
265
+ assert_equal "Rosh Hashanah", (Holidays.on(Date.civil(2018, 9, 10), [:us_tx])[0] || {})[:name]
266
+ assert_equal "Rosh Hashanah", (Holidays.on(Date.civil(2019, 9, 30), [:us_tx])[0] || {})[:name]
267
+
268
+ assert_nil (Holidays.on(Date.civil(2017, 9, 30), [:us])[0] || {})[:name]
269
+ assert_nil (Holidays.on(Date.civil(2018, 9, 19), [:us])[0] || {})[:name]
270
+ assert_nil (Holidays.on(Date.civil(2019, 10, 9), [:us])[0] || {})[:name]
271
+
272
+ assert_equal "Yom Kippur", (Holidays.on(Date.civil(2017, 9, 30), [:us_tx])[0] || {})[:name]
273
+ assert_equal "Yom Kippur", (Holidays.on(Date.civil(2018, 9, 19), [:us_tx])[0] || {})[:name]
274
+ assert_equal "Yom Kippur", (Holidays.on(Date.civil(2019, 10, 9), [:us_tx])[0] || {})[:name]
275
+
276
+ assert_nil (Holidays.on(Date.civil(2017, 10, 9), [:us])[0] || {})[:name]
277
+ assert_nil (Holidays.on(Date.civil(2018, 10, 8), [:us])[0] || {})[:name]
278
+ assert_nil (Holidays.on(Date.civil(2019, 10, 14), [:us])[0] || {})[:name]
279
+
280
+ 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]
281
+ 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]
282
+ 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]
283
+
284
+ 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]
285
+ 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]
286
+ 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]
287
+
288
+ 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]
289
+ 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]
290
+ 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]
291
+
292
+ assert_equal "Alaska Day", (Holidays.on(Date.civil(2017, 10, 18), [:us_ak])[0] || {})[:name]
293
+
294
+ assert_nil (Holidays.on(Date.civil(2017, 10, 27), [:us])[0] || {})[:name]
295
+ assert_nil (Holidays.on(Date.civil(2018, 10, 26), [:us])[0] || {})[:name]
296
+ assert_nil (Holidays.on(Date.civil(2019, 10, 25), [:us])[0] || {})[:name]
297
+
298
+ assert_equal "Nevada Day", (Holidays.on(Date.civil(2017, 10, 27), [:us_nv])[0] || {})[:name]
299
+ assert_equal "Nevada Day", (Holidays.on(Date.civil(2018, 10, 26), [:us_nv])[0] || {})[:name]
300
+ assert_equal "Nevada Day", (Holidays.on(Date.civil(2019, 10, 25), [:us_nv])[0] || {})[:name]
301
+
302
+ assert_nil (Holidays.on(Date.civil(2017, 11, 7), [:us])[0] || {})[:name]
303
+ assert_nil (Holidays.on(Date.civil(2018, 11, 6), [:us])[0] || {})[:name]
304
+ assert_nil (Holidays.on(Date.civil(2021, 11, 2), [:us])[0] || {})[:name]
305
+
306
+ 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]
307
+ 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]
308
+ 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]
309
+
310
+ assert_equal "Veterans Day", (Holidays.on(Date.civil(2017, 11, 10), [:us], [:observed])[0] || {})[:name]
311
+ assert_equal "Veterans Day", (Holidays.on(Date.civil(2018, 11, 12), [:us], [:observed])[0] || {})[:name]
312
+ assert_equal "Veterans Day", (Holidays.on(Date.civil(2019, 11, 11), [:us], [:observed])[0] || {})[:name]
313
+
314
+ assert_equal "Veterans Day", (Holidays.on(Date.civil(2017, 11, 11), [:us])[0] || {})[:name]
315
+
316
+ assert_equal "Thanksgiving", (Holidays.on(Date.civil(2017, 11, 23), [:us])[0] || {})[:name]
317
+ assert_equal "Thanksgiving", (Holidays.on(Date.civil(2018, 11, 22), [:us])[0] || {})[:name]
318
+ assert_equal "Thanksgiving", (Holidays.on(Date.civil(2019, 11, 28), [:us])[0] || {})[:name]
319
+
320
+ assert_nil (Holidays.on(Date.civil(2017, 11, 24), [:us])[0] || {})[:name]
321
+ assert_nil (Holidays.on(Date.civil(2018, 11, 23), [:us])[0] || {})[:name]
322
+ assert_nil (Holidays.on(Date.civil(2019, 11, 29), [:us])[0] || {})[:name]
323
+
324
+ assert_equal "Family Day", (Holidays.on(Date.civil(2017, 11, 24), [:us_nv])[0] || {})[:name]
325
+ assert_equal "Family Day", (Holidays.on(Date.civil(2018, 11, 23), [:us_nv])[0] || {})[:name]
326
+ assert_equal "Family Day", (Holidays.on(Date.civil(2019, 11, 29), [:us_nv])[0] || {})[:name]
327
+
328
+ assert_equal "State Holiday", (Holidays.on(Date.civil(2017, 11, 24), [:us_ga])[0] || {})[:name]
329
+ assert_equal "State Holiday", (Holidays.on(Date.civil(2018, 11, 23), [:us_ga])[0] || {})[:name]
330
+ assert_equal "State Holiday", (Holidays.on(Date.civil(2019, 11, 29), [:us_ga])[0] || {})[:name]
331
+
332
+ assert_equal "Presidents' Day", (Holidays.on(Date.civil(2017, 11, 24), [:us_nm])[0] || {})[:name]
333
+ assert_equal "Presidents' Day", (Holidays.on(Date.civil(2018, 11, 23), [:us_nm])[0] || {})[:name]
334
+ assert_equal "Presidents' Day", (Holidays.on(Date.civil(2019, 11, 29), [:us_nm])[0] || {})[:name]
335
+
336
+ assert_equal "Lincoln's Birthday", (Holidays.on(Date.civil(2017, 11, 24), [:us_in])[0] || {})[:name]
337
+ assert_equal "Lincoln's Birthday", (Holidays.on(Date.civil(2018, 11, 23), [:us_in])[0] || {})[:name]
338
+ assert_equal "Lincoln's Birthday", (Holidays.on(Date.civil(2019, 11, 29), [:us_in])[0] || {})[:name]
339
+
340
+ assert_equal "American Indian Heritage Day", (Holidays.on(Date.civil(2017, 11, 24), [:us_md])[0] || {})[:name]
341
+ assert_equal "American Indian Heritage Day", (Holidays.on(Date.civil(2018, 11, 23), [:us_md])[0] || {})[:name]
342
+ assert_equal "American Indian Heritage Day", (Holidays.on(Date.civil(2019, 11, 29), [:us_md])[0] || {})[:name]
343
+
344
+ 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]
345
+ 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]
346
+ 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]
347
+
348
+ assert_equal "Christmas Eve (Holiday)", (Holidays.on(Date.civil(2022, 12, 23), [:us_mi, :us_sc, :us_va])[0] || {})[:name]
349
+ assert_equal "Christmas Eve (Holiday)", (Holidays.on(Date.civil(2023, 12, 22), [:us_mi, :us_sc, :us_va])[0] || {})[:name]
350
+ assert_equal "Christmas Eve (Holiday)", (Holidays.on(Date.civil(2028, 12, 22), [:us_mi, :us_sc, :us_va])[0] || {})[:name]
351
+
352
+ 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]
353
+
354
+ assert_nil (Holidays.on(Date.civil(2021, 12, 27), [:us])[0] || {})[:name]
355
+ assert_nil (Holidays.on(Date.civil(2022, 12, 26), [:us])[0] || {})[:name]
356
+ assert_nil (Holidays.on(Date.civil(2027, 12, 27), [:us])[0] || {})[:name]
357
+
358
+ assert_equal "Christmas Day", (Holidays.on(Date.civil(2021, 12, 27), [:us], [:observed])[0] || {})[:name]
359
+ assert_equal "Christmas Day", (Holidays.on(Date.civil(2022, 12, 26), [:us], [:observed])[0] || {})[:name]
360
+ assert_equal "Christmas Day", (Holidays.on(Date.civil(2027, 12, 27), [:us], [:observed])[0] || {})[:name]
361
+
362
+ assert_equal "Christmas Day", (Holidays.on(Date.civil(2017, 12, 25), [:us])[0] || {})[:name]
363
+
364
+ 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]
365
+
366
+ assert_equal "New Year's Eve", (Holidays.on(Date.civil(2017, 12, 31), [:us_mi, :us_wi])[0] || {})[:name]
367
+
368
+ assert_equal "Groundhog Day", (Holidays.on(Date.civil(2013, 2, 2), [:us], [:informal])[0] || {})[:name]
369
+
370
+ assert_equal "Valentine's Day", (Holidays.on(Date.civil(2013, 2, 14), [:us], [:informal])[0] || {})[:name]
371
+
372
+ assert_equal "St. Patrick's Day", (Holidays.on(Date.civil(2013, 3, 17), [:us], [:informal])[0] || {})[:name]
373
+
374
+ assert_equal "April Fool's Day", (Holidays.on(Date.civil(2013, 4, 1), [:us], [:informal])[0] || {})[:name]
375
+
376
+ assert_equal "Earth Day", (Holidays.on(Date.civil(2013, 4, 22), [:us], [:informal])[0] || {})[:name]
377
+
378
+ assert_equal "Mother's Day", (Holidays.on(Date.civil(2013, 5, 12), [:us], [:informal])[0] || {})[:name]
379
+
380
+ assert_equal "Armed Forces Day", (Holidays.on(Date.civil(2013, 5, 18), [:us], [:informal])[0] || {})[:name]
381
+
382
+ assert_equal "Father's Day", (Holidays.on(Date.civil(2013, 6, 16), [:us], [:informal])[0] || {})[:name]
383
+
384
+ assert_equal "Halloween", (Holidays.on(Date.civil(2013, 10, 31), [:us], [:informal])[0] || {})[:name]
269
385
 
270
386
  end
271
387
  end