holidays 5.6.0 → 5.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (42) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +7 -0
  3. data/README.md +1 -1
  4. data/holidays.gemspec +2 -1
  5. data/lib/generated_definitions/MANIFEST +8 -0
  6. data/lib/generated_definitions/REGIONS.rb +2 -2
  7. data/lib/generated_definitions/au.rb +2 -2
  8. data/lib/generated_definitions/de.rb +4 -4
  9. data/lib/generated_definitions/ee.rb +36 -0
  10. data/lib/generated_definitions/europe.rb +8 -4
  11. data/lib/generated_definitions/fr.rb +5 -3
  12. data/lib/generated_definitions/ge.rb +41 -0
  13. data/lib/generated_definitions/mt_en.rb +38 -0
  14. data/lib/generated_definitions/mt_mt.rb +38 -0
  15. data/lib/generated_definitions/north_america.rb +106 -9
  16. data/lib/generated_definitions/nz.rb +0 -1
  17. data/lib/generated_definitions/pt.rb +4 -2
  18. data/lib/generated_definitions/rs_cyrl.rb +39 -0
  19. data/lib/generated_definitions/rs_la.rb +39 -0
  20. data/lib/generated_definitions/ru.rb +37 -0
  21. data/lib/generated_definitions/tr.rb +61 -0
  22. data/lib/generated_definitions/us.rb +112 -15
  23. data/lib/holidays/version.rb +1 -1
  24. data/test/coverage_report.rb +4 -2
  25. data/test/defs/test_defs_au.rb +2 -2
  26. data/test/defs/test_defs_de.rb +39 -37
  27. data/test/defs/test_defs_ee.rb +33 -0
  28. data/test/defs/test_defs_europe.rb +84 -68
  29. data/test/defs/test_defs_fr.rb +21 -13
  30. data/test/defs/test_defs_ge.rb +41 -0
  31. data/test/defs/test_defs_mt_en.rb +32 -0
  32. data/test/defs/test_defs_mt_mt.rb +32 -0
  33. data/test/defs/test_defs_north_america.rb +244 -16
  34. data/test/defs/test_defs_pt.rb +24 -18
  35. data/test/defs/test_defs_rs_cyrl.rb +39 -0
  36. data/test/defs/test_defs_rs_la.rb +39 -0
  37. data/test/defs/test_defs_ru.rb +28 -0
  38. data/test/defs/test_defs_tr.rb +44 -0
  39. data/test/defs/test_defs_us.rb +245 -17
  40. data/test/integration/test_available_regions.rb +1 -1
  41. data/test/integration/test_holidays.rb +2 -2
  42. metadata +65 -26
@@ -0,0 +1,33 @@
1
+ # encoding: utf-8
2
+ require File.expand_path(File.dirname(__FILE__)) + '/../test_helper'
3
+
4
+ # This file is generated by the Ruby Holiday gem.
5
+ #
6
+ # Definitions loaded: definitions/ee.yaml
7
+ class EeDefinitionTests < Test::Unit::TestCase # :nodoc:
8
+
9
+ def test_ee
10
+ { Date.civil(2017, 1, 1) => 'uusaasta',
11
+ Date.civil(2017, 2, 24) => 'iseseisvuspäev',
12
+ Date.civil(2017, 5, 1) => 'kevadpüha',
13
+ Date.civil(2017, 6, 23) => 'võidupüha ja jaanilaupäev',
14
+ Date.civil(2017, 6, 24) => 'jaanipäev',
15
+ Date.civil(2017, 8, 20) => 'taasiseseisvumispäev',
16
+ Date.civil(2017, 12, 24) => 'jõululaupäev',
17
+ Date.civil(2017, 12, 25) => 'esimene jõulupüha',
18
+ Date.civil(2017, 12, 26) => 'teine jõulupüha' }.each do |date, name|
19
+ assert_equal name, (Holidays.on(date, :ee)[0] || {})[:name]
20
+ end
21
+
22
+ [Date.civil(2017, 4, 14), Date.civil(2018, 3, 30), Date.civil(2019, 4, 19)].each do |date|
23
+ assert_equal 'suur reede', Holidays.on(date, :ee)[0][:name]
24
+ end
25
+ [Date.civil(2017, 4, 16), Date.civil(2018, 4, 01), Date.civil(2019, 4, 21)].each do |date|
26
+ assert_equal 'ülestõusmispühade 1. püha', Holidays.on(date, :ee)[0][:name]
27
+ end
28
+ [Date.civil(2017, 6, 4), Date.civil(2018, 5, 20), Date.civil(2019, 6, 9)].each do |date|
29
+ assert_equal 'nelipühade 1. püha', Holidays.on(date, :ee)[0][:name]
30
+ end
31
+
32
+ end
33
+ end
@@ -120,78 +120,80 @@ end
120
120
  end
121
121
 
122
122
 
123
- {Date.civil(2009,1,1) => 'Neujahrstag',
124
- Date.civil(2009,4,10) => 'Karfreitag',
125
- Date.civil(2009,4,12) => 'Ostersonntag',
126
- Date.civil(2009,4,13) => 'Ostermontag',
127
- Date.civil(2009,5,1) => 'Tag der Arbeit',
128
- Date.civil(2009,5,21) => 'Christi Himmelfahrt',
129
- Date.civil(2009,5,31) => 'Pfingstsonntag',
130
- Date.civil(2009,6,1) => 'Pfingstmontag',
131
- Date.civil(2009,10,3) => 'Tag der Deutschen Einheit',
132
- Date.civil(2009,12,24) => 'Heilig Abend',
133
- Date.civil(2009,12,25) => '1. Weihnachtstag',
134
- Date.civil(2009,12,26) => '2. Weihnachtstag',
135
- Date.civil(2009,12,31) => 'Silvester'}.each do |date, name|
123
+ { Date.civil(2009, 1, 1) => 'Neujahrstag',
124
+ Date.civil(2009, 4, 10) => 'Karfreitag',
125
+ Date.civil(2009, 4, 12) => 'Ostersonntag',
126
+ Date.civil(2009, 4, 13) => 'Ostermontag',
127
+ Date.civil(2009, 5, 1) => 'Tag der Arbeit',
128
+ Date.civil(2009, 5, 21) => 'Christi Himmelfahrt',
129
+ Date.civil(2009, 5, 31) => 'Pfingstsonntag',
130
+ Date.civil(2009, 6, 1) => 'Pfingstmontag',
131
+ Date.civil(2009, 10, 3) => 'Tag der Deutschen Einheit',
132
+ Date.civil(2009, 12, 24) => 'Heilig Abend',
133
+ Date.civil(2009, 12, 25) => '1. Weihnachtstag',
134
+ Date.civil(2009, 12, 26) => '2. Weihnachtstag',
135
+ Date.civil(2009, 12, 31) => 'Silvester' }.each do |date, name|
136
136
  assert_equal name, (Holidays.on(date, :de, :informal)[0] || {})[:name], "Failed on '#{name}' for date '#{date}'"
137
137
  end
138
138
 
139
139
  [:de_bw, :de_by, :de_st, :de_].each do |r|
140
- assert_equal 'Heilige Drei Könige', Holidays.on(Date.civil(2009,1,6), r)[0][:name]
140
+ assert_equal 'Heilige Drei Könige', Holidays.on(Date.civil(2009, 1, 6), r)[0][:name]
141
141
  end
142
142
 
143
- [:de_bw, :de_by, :de_he, :de_nw, :de_rp, :de_sl, :de_sn_sorbian, :de_th_eichsfeld, :de_].each do |r|
144
- assert_equal 'Fronleichnam', Holidays.on(Date.civil(2009,6,11), r)[0][:name]
143
+ assert_equal [],Holidays.on(Date.civil(2017, 6, 15), [:de_th, :de_sn])
144
+ [:de_bw, :de_by, :de_he, :de_nw, :de_rp, :de_sl, :de_sn_sorbian, :de_th_cath].each do |r|
145
+ assert_equal 'Fronleichnam', Holidays.on(Date.civil(2017, 6, 15), r)[0][:name]
145
146
  end
146
147
 
147
- [:de_by, :de_sl, :de_].each do |r|
148
- assert_equal 'Mariä Himmelfahrt', Holidays.on(Date.civil(2009,8,15), r)[0][:name]
148
+ assert_equal [], Holidays.on(Date.civil(2017, 8, 15), [:de_by, :de_sn])
149
+ [:de_by_cath, :de_by_augsburg, :de_sl].each do |r|
150
+ assert_equal 'Mariä Himmelfahrt', Holidays.on(Date.civil(2017, 8, 15), r)[0][:name]
149
151
  end
150
152
 
151
- [:de_bb, :de_mv, :de_sn, :de_st, :de_th, :de_].each do |r|
152
- assert_equal 'Reformationstag', Holidays.on(Date.civil(2009,10,31), r)[0][:name]
153
+ [:de_sh, :de_ni, :de_hh, :de_hb, :de_be, :de_bb, :de_mv, :de_sn, :de_st, :de_th, :de_].each do |r|
154
+ assert_equal 'Reformationstag', Holidays.on(Date.civil(2017, 10, 31), r)[0][:name]
153
155
  end
154
156
 
155
157
  # Free day in schools
156
158
  [:de_bw].each do |r|
157
- assert_equal 'Reformationstag', Holidays.on(Date.civil(2009,10,31), r, :informal)[0][:name]
159
+ assert_equal 'Reformationstag', Holidays.on(Date.civil(2009, 10, 31), r, :informal)[0][:name]
158
160
  end
159
161
 
160
162
  # 500 years reformation in 2017
161
- assert_equal 'Reformationstag', Holidays.on(Date.civil(2017,10,31), :de)[0][:name]
162
- assert_equal [], Holidays.on(Date.civil(2016,10,31), :de), "Reformationstag is not a holiday in 2016 in whole Germany"
163
- assert_equal [], Holidays.on(Date.civil(2018,10,31), :de), "Reformationstag is not a holiday in 2018 in whole Germany"
163
+ assert_equal 'Reformationstag', Holidays.on(Date.civil(2017, 10, 31), :de)[0][:name]
164
+ assert_equal [], Holidays.on(Date.civil(2016, 10, 31), :de), "Reformationstag is not a holiday in 2016 in whole Germany"
165
+ assert_equal [], Holidays.on(Date.civil(2018, 10, 31), :de), "Reformationstag is not a holiday in 2018 in whole Germany"
164
166
 
165
167
  [:de_bw, :de_by, :de_nw, :de_rp, :de_sl, :de_].each do |r|
166
- assert_equal 'Allerheiligen', Holidays.on(Date.civil(2009,11,1), r)[0][:name]
168
+ assert_equal 'Allerheiligen', Holidays.on(Date.civil(2009, 11, 1), r)[0][:name]
167
169
  end
168
170
 
169
171
  [:de_by_augsburg].each do |r|
170
- assert_equal 'Friedensfest', Holidays.on(Date.civil(2015,8,8),r)[0][:name]
172
+ assert_equal 'Friedensfest', Holidays.on(Date.civil(2015, 8, 8), r)[0][:name]
171
173
  end
172
174
 
173
175
  [:de,
174
176
  :de_bw, :de_by, :de_bb, :de_he, :de_mv,
175
177
  :de_nw, :de_rp, :de_sl, :de_sn, :de_st, :de_th].each do |r|
176
- assert_equal [], Holidays.on(Date.civil(2015,8,8), r), "Friedensfest is not a holiday in #{r}"
178
+ assert_equal [], Holidays.on(Date.civil(2015, 8, 8), r), "Friedensfest is not a holiday in #{r}"
177
179
  end
178
180
 
179
- assert_equal [], Holidays.on(Date.civil(2010,5,8), :de), '2010-05-08 is not a holiday in Germany'
181
+ assert_equal [], Holidays.on(Date.civil(2010, 5, 8), :de), '2010-05-08 is not a holiday in Germany'
180
182
 
181
- assert_equal [], Holidays.on(Date.civil(2010,8,8), :de), '2010-08-08 is not a holiday in Germany'
183
+ assert_equal [], Holidays.on(Date.civil(2010, 8, 8), :de), '2010-08-08 is not a holiday in Germany'
182
184
 
183
185
  # Repentance Day
184
- assert_equal 'Buß- und Bettag', Holidays.on(Date.civil(2004,11,17), :de_sn)[0][:name]
185
- assert_equal 'Buß- und Bettag', Holidays.on(Date.civil(2005,11,16), :de_sn)[0][:name]
186
- assert_equal 'Buß- und Bettag', Holidays.on(Date.civil(2006,11,22), :de_sn)[0][:name]
187
- assert_equal 'Buß- und Bettag', Holidays.on(Date.civil(2009,11,18), :de_sn)[0][:name]
186
+ assert_equal 'Buß- und Bettag', Holidays.on(Date.civil(2004, 11, 17), :de_sn)[0][:name]
187
+ assert_equal 'Buß- und Bettag', Holidays.on(Date.civil(2005, 11, 16), :de_sn)[0][:name]
188
+ assert_equal 'Buß- und Bettag', Holidays.on(Date.civil(2006, 11, 22), :de_sn)[0][:name]
189
+ assert_equal 'Buß- und Bettag', Holidays.on(Date.civil(2009, 11, 18), :de_sn)[0][:name]
188
190
 
189
191
  # Carnival
190
192
  [:de_bw, :de_by, :de_he, :de_nw, :de_rp, :de_sl, :de_sn].each do |r|
191
- assert_equal 'Weiberfastnacht', Holidays.on(Date.civil(2016,2,4),r,:informal)[0][:name]
192
- assert_equal 'Rosenmontag', Holidays.on(Date.civil(2016,2,8),r,:informal)[0][:name]
193
- assert_equal 'Aschermittwoch', Holidays.on(Date.civil(2016,2,10),r,:informal)[0][:name]
194
- end
193
+ assert_equal 'Weiberfastnacht', Holidays.on(Date.civil(2016, 2, 4), r, :informal)[0][:name]
194
+ assert_equal 'Rosenmontag', Holidays.on(Date.civil(2016, 2, 8), r, :informal)[0][:name]
195
+ assert_equal 'Aschermittwoch', Holidays.on(Date.civil(2016, 2, 10), r, :informal)[0][:name]
196
+ end
195
197
 
196
198
 
197
199
  {Date.civil(2011,1,1) => 'Πρωτοχρονιά',
@@ -276,25 +278,33 @@ assert_equal 'Día de Extremadura', Holidays.on(Date.civil(2009,9,8), :es_ex)[0]
276
278
  assert_equal 'Fiesta Nacional de Cataluña', Holidays.on(Date.civil(2009,9,11), :es_ct)[0][:name]
277
279
 
278
280
 
279
- {Date.civil(2007,1,1) => 'Jour de l\'an',
280
- Date.civil(2007,4,9) => 'Lundi de Pâques',
281
- Date.civil(2007,5,1) => 'Fête du travail',
282
- Date.civil(2007,5,8) => 'Victoire 1945',
283
- Date.civil(2007,5,17) => 'Ascension',
284
- Date.civil(2007,5,28) => 'Lundi de Pentecôte',
285
- Date.civil(2007,7,14) => 'Fête nationale',
286
- Date.civil(2007,8,15) => 'Assomption',
287
- Date.civil(2007,11,1) => 'Toussaint',
288
- Date.civil(2007,11,11) => 'Armistice 1918',
289
- Date.civil(2007,12,25) => 'Noël'}.each do |date, name|
281
+ { Date.civil(2007, 1, 1) => 'Jour de l\'an',
282
+ Date.civil(2007, 4, 9) => 'Lundi de Pâques',
283
+ Date.civil(2007, 5, 1) => 'Fête du travail',
284
+ Date.civil(2007, 5, 8) => 'Victoire 1945',
285
+ Date.civil(2007, 5, 17) => 'Ascension',
286
+ Date.civil(2007, 5, 28) => 'Lundi de Pentecôte',
287
+ Date.civil(2007, 7, 14) => 'Fête nationale',
288
+ Date.civil(2007, 8, 15) => 'Assomption',
289
+ Date.civil(2007, 11, 1) => 'Toussaint',
290
+ Date.civil(2007, 11, 11) => 'Armistice 1918',
291
+ Date.civil(2007, 12, 25) => 'Noël' }.each do |date, name|
290
292
  assert_equal name, (Holidays.on(date, :fr)[0] || {})[:name]
291
293
  end
292
- {Date.civil(2007,4,8) => 'Pâques',
293
- Date.civil(2007,5,27) => 'Pentecôte'}.each do |date, name|
294
+ { Date.civil(2007, 4, 8) => 'Pâques',
295
+ Date.civil(2007, 5, 27) => 'Pentecôte' }.each do |date, name|
294
296
  assert_nil (Holidays.on(date, :fr)[0] || {})[:name]
295
297
  assert_equal name, (Holidays.on(date, :fr, :informal)[0] || {})[:name]
296
298
  end
297
299
 
300
+ [Date.civil(2017, 4, 14), Date.civil(2018, 3, 30), Date.civil(2019, 4, 19)].each do |date|
301
+ assert_nil (Holidays.on(date, :fr)[0] || {})[:name]
302
+ assert_equal 'Vendredi saint', Holidays.on(date, [:fr_a, :fr_m])[0][:name]
303
+ end
304
+
305
+ assert_nil Holidays.on(Date.civil(2017, 12, 26), [:fr])[0] || {}[:name]
306
+ assert_equal 'Saint-Étienne', Holidays.on(Date.civil(2017, 12, 26), [:fr_a, :fr_m])[0][:name]
307
+
298
308
 
299
309
  {Date.civil(2008,3,21) => 'Good Friday',
300
310
  Date.civil(2008,3,23) => 'Easter Sunday',
@@ -685,27 +695,33 @@ end
685
695
  assert_equal 'Święto Wojska Polskiego', (Holidays.on(Date.civil(2011,8,15), :pl)[1] || {})[:name]
686
696
 
687
697
 
688
- {Date.civil(2008,1,1) => 'Ano Novo',
689
- Date.civil(2005,2,8) => 'Carnaval',
690
- Date.civil(2006,2,28) => 'Carnaval',
691
- Date.civil(2007,2,20) => 'Carnaval',
692
- Date.civil(2008,2,5) => 'Carnaval',
693
- Date.civil(2008,3,21) => 'Sexta-feira Santa',
694
- Date.civil(2008,3,23) => 'Páscoa',
695
- Date.civil(2016,3,27) => 'Páscoa',
696
- Date.civil(2008,4,25) => 'Dia da Liberdade',
697
- Date.civil(2008,5,1) => 'Dia do Trabalhador',
698
- Date.civil(2016,5,26) => 'Corpo de Deus',
699
- Date.civil(2008,6,10) => 'Dia de Portugal',
700
- Date.civil(2008,8,15) => 'Assunção de Nossa Senhora',
701
- Date.civil(2008,10,5) => 'Dia da República',
702
- Date.civil(2008,11,1) => 'Dia de Todos-os-Santos',
703
- Date.civil(2008,12,1) => 'Restauração da Independência',
704
- Date.civil(2008,12,8) => 'Imaculada Conceição',
705
- Date.civil(2008,12,25) => 'Natal'}.each do |date, name|
698
+ { Date.civil(2008, 1, 1) => 'Ano Novo',
699
+ Date.civil(2005, 2, 8) => 'Carnaval',
700
+ Date.civil(2006, 2, 28) => 'Carnaval',
701
+ Date.civil(2007, 2, 20) => 'Carnaval',
702
+ Date.civil(2008, 2, 5) => 'Carnaval',
703
+ Date.civil(2008, 3, 21) => 'Sexta-feira Santa',
704
+ Date.civil(2008, 3, 23) => 'Páscoa',
705
+ Date.civil(2016, 3, 27) => 'Páscoa',
706
+ Date.civil(2008, 4, 25) => 'Dia da Liberdade',
707
+ Date.civil(2008, 5, 1) => 'Dia do Trabalhador',
708
+ Date.civil(2016, 5, 26) => 'Corpo de Deus',
709
+ Date.civil(2008, 6, 10) => 'Dia de Portugal',
710
+ Date.civil(2008, 8, 15) => 'Assunção de Nossa Senhora',
711
+ Date.civil(2008, 10, 5) => 'Dia da República',
712
+ Date.civil(2008, 11, 1) => 'Dia de Todos-os-Santos',
713
+ Date.civil(2008, 12, 1) => 'Restauração da Independência',
714
+ Date.civil(2008, 12, 8) => 'Imaculada Conceição',
715
+ Date.civil(2008, 12, 25) => 'Natal' }.each do |date, name|
706
716
  assert_equal name, (Holidays.on(date, :pt, :informal)[0] || {})[:name]
707
717
  end
708
718
 
719
+ assert_nil Holidays.on(Date.civil(2017, 6, 13), [:pt])[0] || {}[:name]
720
+ assert_equal 'Dia de Santo António', Holidays.on(Date.civil(2017, 6, 13), [:pt_li])[0][:name]
721
+
722
+ assert_nil Holidays.on(Date.civil(2017, 6, 24), [:pt])[0] || {}[:name]
723
+ assert_equal 'Dia de São João', Holidays.on(Date.civil(2017, 6, 24), [:pt_po])[0][:name]
724
+
709
725
 
710
726
  {
711
727
  Date.civil(1961,4,9) => 'Paștele - duminică',
@@ -7,24 +7,32 @@ require File.expand_path(File.dirname(__FILE__)) + '/../test_helper'
7
7
  class FrDefinitionTests < Test::Unit::TestCase # :nodoc:
8
8
 
9
9
  def test_fr
10
- {Date.civil(2007,1,1) => 'Jour de l\'an',
11
- Date.civil(2007,4,9) => 'Lundi de Pâques',
12
- Date.civil(2007,5,1) => 'Fête du travail',
13
- Date.civil(2007,5,8) => 'Victoire 1945',
14
- Date.civil(2007,5,17) => 'Ascension',
15
- Date.civil(2007,5,28) => 'Lundi de Pentecôte',
16
- Date.civil(2007,7,14) => 'Fête nationale',
17
- Date.civil(2007,8,15) => 'Assomption',
18
- Date.civil(2007,11,1) => 'Toussaint',
19
- Date.civil(2007,11,11) => 'Armistice 1918',
20
- Date.civil(2007,12,25) => 'Noël'}.each do |date, name|
10
+ { Date.civil(2007, 1, 1) => 'Jour de l\'an',
11
+ Date.civil(2007, 4, 9) => 'Lundi de Pâques',
12
+ Date.civil(2007, 5, 1) => 'Fête du travail',
13
+ Date.civil(2007, 5, 8) => 'Victoire 1945',
14
+ Date.civil(2007, 5, 17) => 'Ascension',
15
+ Date.civil(2007, 5, 28) => 'Lundi de Pentecôte',
16
+ Date.civil(2007, 7, 14) => 'Fête nationale',
17
+ Date.civil(2007, 8, 15) => 'Assomption',
18
+ Date.civil(2007, 11, 1) => 'Toussaint',
19
+ Date.civil(2007, 11, 11) => 'Armistice 1918',
20
+ Date.civil(2007, 12, 25) => 'Noël' }.each do |date, name|
21
21
  assert_equal name, (Holidays.on(date, :fr)[0] || {})[:name]
22
22
  end
23
- {Date.civil(2007,4,8) => 'Pâques',
24
- Date.civil(2007,5,27) => 'Pentecôte'}.each do |date, name|
23
+ { Date.civil(2007, 4, 8) => 'Pâques',
24
+ Date.civil(2007, 5, 27) => 'Pentecôte' }.each do |date, name|
25
25
  assert_nil (Holidays.on(date, :fr)[0] || {})[:name]
26
26
  assert_equal name, (Holidays.on(date, :fr, :informal)[0] || {})[:name]
27
27
  end
28
28
 
29
+ [Date.civil(2017, 4, 14), Date.civil(2018, 3, 30), Date.civil(2019, 4, 19)].each do |date|
30
+ assert_nil (Holidays.on(date, :fr)[0] || {})[:name]
31
+ assert_equal 'Vendredi saint', Holidays.on(date, [:fr_a, :fr_m])[0][:name]
32
+ end
33
+
34
+ assert_nil Holidays.on(Date.civil(2017, 12, 26), [:fr])[0] || {}[:name]
35
+ assert_equal 'Saint-Étienne', Holidays.on(Date.civil(2017, 12, 26), [:fr_a, :fr_m])[0][:name]
36
+
29
37
  end
30
38
  end
@@ -0,0 +1,41 @@
1
+ # encoding: utf-8
2
+ require File.expand_path(File.dirname(__FILE__)) + '/../test_helper'
3
+
4
+ # This file is generated by the Ruby Holiday gem.
5
+ #
6
+ # Definitions loaded: definitions/ge.yaml
7
+ class GeDefinitionTests < Test::Unit::TestCase # :nodoc:
8
+
9
+ def test_ge
10
+ { Date.civil(2017, 1, 1) => 'ახალი წელი',
11
+ Date.civil(2017, 1, 2) => 'ბედობა',
12
+ Date.civil(2017, 1, 7) => 'ქრისტეშობა',
13
+ Date.civil(2017, 1, 19) => 'ნათლისღება',
14
+ Date.civil(2017, 3, 3) => 'დედის დღე',
15
+ Date.civil(2017, 3, 8) => 'ქალთა საერთაშორისო დღე',
16
+ Date.civil(2017, 4, 9) => 'ეროვნული ერთიანობის დღე',
17
+ Date.civil(2017, 5, 9) => 'ფაშიზმზე გამარჯვების დღე',
18
+ Date.civil(2017, 5, 12) => 'წმინდა მოციქულის ანდრია პირველწოდებულის საქართველოში შემოსვლის დღე',
19
+ Date.civil(2017, 5, 26) => 'დამოუკიდებლობის დღე',
20
+ Date.civil(2017, 8, 28) => 'მარიამობა',
21
+ Date.civil(2017, 10, 14) => 'სვეტიცხოვლობა',
22
+ Date.civil(2017, 11, 23) => 'გიორგობა'
23
+ }.each do |date, name|
24
+ assert_equal name, (Holidays.on(date, :ge)[0] || {})[:name]
25
+ end
26
+
27
+ [Date.civil(2017, 4, 14), Date.civil(2018, 4, 6), Date.civil(2019, 4, 26)].each do |date|
28
+ assert_equal 'დიდი პარასკევი', Holidays.on(date, :ge)[0][:name]
29
+ end
30
+ [Date.civil(2017, 4, 15), Date.civil(2018, 4, 7), Date.civil(2019, 4, 27)].each do |date|
31
+ assert_equal 'დიდი შაბათი', Holidays.on(date, :ge)[0][:name]
32
+ end
33
+ [Date.civil(2017, 4, 16), Date.civil(2018, 4, 8), Date.civil(2019, 4, 28)].each do |date|
34
+ assert_equal 'ბრწყინვალე აღდგომის დღე', Holidays.on(date, :ge)[0][:name]
35
+ end
36
+ [Date.civil(2017, 4, 17), Date.civil(2018, 4, 9), Date.civil(2019, 4, 29)].each do |date|
37
+ assert_equal 'მიცვალებულთა', Holidays.on(date, :ge)[0][:name]
38
+ end
39
+
40
+ end
41
+ end
@@ -0,0 +1,32 @@
1
+ # encoding: utf-8
2
+ require File.expand_path(File.dirname(__FILE__)) + '/../test_helper'
3
+
4
+ # This file is generated by the Ruby Holiday gem.
5
+ #
6
+ # Definitions loaded: definitions/mt_en.yaml
7
+ class Mt_enDefinitionTests < Test::Unit::TestCase # :nodoc:
8
+
9
+ def test_mt_en
10
+ { Date.civil(2017, 1, 1) => "New Year's Day",
11
+ Date.civil(2017, 2, 10) => "Feast of Saint Paul's Shipwreck in Malta",
12
+ Date.civil(2017, 3, 19) => 'Feast of Saint Joseph',
13
+ Date.civil(2017, 3, 31) => 'Freedom Day',
14
+ Date.civil(2017, 5, 1) => "Worker's Day",
15
+ Date.civil(2017, 6, 7) => 'Sette Giugno',
16
+ Date.civil(2017, 6, 29) => 'Feast of Saint Peter & Saint Paul',
17
+ Date.civil(2017, 8, 15) => 'Feast of the Assumption of Our Lady',
18
+ Date.civil(2017, 9, 8) => 'Victory Day',
19
+ Date.civil(2017, 9, 21) => 'Independence Day',
20
+ Date.civil(2017, 12, 8) => 'Feast of the Immaculate Conception',
21
+ Date.civil(2017, 12, 13) => 'Republic Day',
22
+ Date.civil(2017, 12, 25) => 'Christmas Day',
23
+ }.each do |date, name|
24
+ assert_equal name, (Holidays.on(date, :mt_en)[0] || {})[:name]
25
+ end
26
+
27
+ [Date.civil(2017, 4, 14), Date.civil(2018, 3, 30), Date.civil(2019, 4, 19)].each do |date|
28
+ assert_equal 'Good Friday', Holidays.on(date, :mt_en)[0][:name]
29
+ end
30
+
31
+ end
32
+ end
@@ -0,0 +1,32 @@
1
+ # encoding: utf-8
2
+ require File.expand_path(File.dirname(__FILE__)) + '/../test_helper'
3
+
4
+ # This file is generated by the Ruby Holiday gem.
5
+ #
6
+ # Definitions loaded: definitions/mt_mt.yaml
7
+ class Mt_mtDefinitionTests < Test::Unit::TestCase # :nodoc:
8
+
9
+ def test_mt_mt
10
+ { Date.civil(2017, 1, 1) => 'L-Ewwel tas-Sena',
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
26
+
27
+ [Date.civil(2017, 4, 14), Date.civil(2018, 3, 30), Date.civil(2019, 4, 19)].each do |date|
28
+ assert_equal 'Il-Ġimgħa l-Kbira', Holidays.on(date, :mt_mt)[0][:name]
29
+ end
30
+
31
+ end
32
+ end
@@ -208,24 +208,252 @@ end
208
208
  end
209
209
 
210
210
 
211
- {Date.civil(2008,1,1) => 'New Year\'s Day',
212
- Date.civil(2008,1,21) => 'Martin Luther King, Jr. Day',
213
- Date.civil(2008,2,18) => 'Presidents\' Day',
214
- Date.civil(2008,5,26) => 'Memorial Day',
215
- Date.civil(2008,7,4) => 'Independence Day',
216
- Date.civil(2008,9,1) => 'Labor Day',
217
- Date.civil(2008,10,13) => 'Columbus Day',
218
- Date.civil(2008,11,11) => 'Veterans Day',
219
- Date.civil(2008,11,27) => 'Thanksgiving',
220
- Date.civil(2013,11,28) => 'Thanksgiving',
221
- Date.civil(2008,12,25) => 'Christmas Day'}.each do |date, name|
222
- assert_equal name, (Holidays.on(date, :us)[0] || {})[:name]
211
+ [Date.civil(2017, 2, 28), Date.civil(2018, 2, 13), Date.civil(2019, 3, 5)].each do |date|
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]
223
221
  end
224
- {Date.civil(2008, 3, 31) => 'Cesar Chavez Day',
225
- Date.civil(2008, 11, 28) => 'Day after Thanksgiving',
226
- Date.civil(2013, 11, 29) => 'Day after Thanksgiving'}.each do |date, name|
227
- assert_equal name, (Holidays.on(date, :us, :us_ca)[0] || {})[:name]
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
226
+
227
+ assert_equal "New Year's Day", Holidays.on(Date.civil(2017, 1, 1), [:us])[0][:name]
228
+ assert_equal "New Year's Day", Holidays.on(Date.civil(2017, 1, 2), :observed, [:us])[0][:name]
229
+
230
+ [Date.civil(2017, 1, 16), Date.civil(2018, 1, 15), Date.civil(2019, 1, 21)].each do |date|
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
245
+
246
+ states_inauguration = %i{us_tx us_dc us_la us_md us_va}
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]
252
+
253
+ [Date.civil(2017, 1, 13), Date.civil(2018, 1, 12), Date.civil(2019, 1, 18)].each do |date|
254
+ assert_equal [], Holidays.on(date, [:us])
255
+ assert_equal 'Lee-Jackson Day', Holidays.on(date, [:us_va])[0][:name]
256
+ end
257
+
258
+ assert_equal 'Confederate Heroes Day', Holidays.on(Date.civil(2017, 1, 19), [:us_tx])[0][:name]
259
+
260
+ [Date.civil(2008, 2, 18), Date.civil(2017, 2, 20), Date.civil(2018, 2, 19)].each do |date|
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
271
+
272
+ assert_equal 'Texas Independence Day', Holidays.on(Date.civil(2017, 3, 2), [:us_tx])[0][:name]
273
+
274
+ [Date.civil(2017, 3, 27), Date.civil(2018, 3, 26), Date.civil(2022, 3, 25)].each do |date|
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]
280
+
281
+ [Date.civil(2017, 3, 27), Date.civil(2018, 3, 26), Date.civil(2019, 3, 25)].each do |date|
282
+ assert_equal [], Holidays.on(date, [:us])
283
+ assert_equal "Seward's Day", Holidays.on(date, [:us_ak])[0][:name]
284
+ end
285
+
286
+ assert_equal 'César Chávez Day', Holidays.on(Date.civil(2017, 3, 31), [:us_ca])[0][:name]
287
+
288
+ [Date.civil(2023, 4, 17), Date.civil(2022, 4, 15), Date.civil(2028, 4, 17)].each do |date|
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]
292
+
293
+ [Date.civil(2017, 4, 17), Date.civil(2018, 4, 16), Date.civil(2019, 4, 15)].each do |date|
294
+ assert_equal [], Holidays.on(date, [:us])
295
+ assert_equal "Patriots' Day", Holidays.on(date, [:us_me, :us_ma])[0][:name]
296
+ end
297
+
298
+ assert_equal 'San Jacinto Day', Holidays.on(Date.civil(2017, 4, 21), [:us_tx])[0][:name]
299
+
300
+ [Date.civil(2017, 4, 24), Date.civil(2018, 4, 30), Date.civil(2019, 4, 29)].each do |date|
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]
310
+
311
+ [Date.civil(2015, 4, 20), Date.civil(2021, 4, 26)].each do |date|
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
315
+
316
+ assert_equal 'Arbor Day', Holidays.on(Date.civil(2017, 4, 28), [:us_ne])[0][:name]
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]
319
+
320
+ [Date.civil(2017, 5, 29), Date.civil(2018, 5, 28), Date.civil(2019, 5, 27)].each do |date|
321
+ assert_equal 'Memorial Day', Holidays.on(date, [:us])[0][:name]
322
+ end
323
+
324
+ [Date.civil(2017, 6, 5), Date.civil(2018, 6, 4), Date.civil(2019, 6, 3)].each do |date|
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]
329
+
330
+ [Date.civil(2017, 6, 12), Date.civil(2018, 6, 11), Date.civil(2022, 6, 10)].each do |date|
331
+ assert_equal [], Holidays.on(date, [:us])
332
+ assert_equal 'King Kamehameha I Day', Holidays.on(date, [:us_hi], :observed)[0][:name]
228
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]
336
+
337
+ assert_equal 'Emancipation Day in Texas', Holidays.on(Date.civil(2017, 6, 19), [:us_tx])[0][:name]
338
+
339
+ [Date.civil(2017, 6, 20), Date.civil(2020, 6, 19), Date.civil(2021, 6, 21)].each do |date|
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]
345
+
346
+ assert_equal 'Emancipation Day', Holidays.on(Date.civil(2017, 7, 3), [:us_vi])[0][:name]
347
+
348
+ [Date.civil(2020, 7, 4), Date.civil(2021, 7, 4), Date.civil(2026, 7, 4)].each do |date|
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
356
+
357
+ assert_equal 'Pioneer Day', Holidays.on(Date.civil(2017, 7, 24), [:us_ut])[0][:name]
358
+
359
+ [Date.civil(2017, 8, 14), Date.civil(2020, 8, 10), Date.civil(2021, 8, 9)].each do |date|
360
+ assert_equal [], Holidays.on(date, [:us])
361
+ assert_equal 'Victory Day', Holidays.on(date, [:us_ri])[0][:name]
362
+ end
363
+
364
+ [Date.civil(2017, 8, 16), Date.civil(2020, 8, 17), Date.civil(2025, 8, 15)].each do |date|
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]
370
+
371
+ [Date.civil(2017, 8, 18), Date.civil(2020, 8, 21), Date.civil(2025, 8, 15)].each do |date|
372
+ assert_equal [], Holidays.on(date, [:us])
373
+ assert_equal 'Statehood Day', Holidays.on(date, [:us_hi])[0][:name]
374
+ end
375
+
376
+ assert_equal 'Lyndon Baines Johnson Day', Holidays.on(Date.civil(2017, 8, 27), [:us_tx])[0][:name]
377
+
378
+ [Date.civil(2017, 9, 4), Date.civil(2018, 9, 3), Date.civil(2019, 9, 2)].each do |date|
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
389
+
390
+ states_columbus_day_formal =
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
402
+
403
+ assert_equal 'Alaska Day', Holidays.on(Date.civil(2017, 10, 18), [:us_ak])[0][:name]
404
+
405
+ [Date.civil(2017, 10, 27), Date.civil(2018, 10, 26), Date.civil(2019, 10, 25)].each do |date|
406
+ assert_equal [], Holidays.on(date, [:us])
407
+ assert_equal 'Nevada Day', Holidays.on(date, :us_nv)[0][:name]
408
+ end
409
+
410
+ states_election_day = %i{us_de us_hi us_il us_in us_mt us_nj us_ny us_pa us_ri}
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
415
+
416
+ [Date.civil(2017, 11, 10), Date.civil(2018, 11, 12), Date.civil(2019, 11, 11)].each do |date|
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]
420
+
421
+ [Date.civil(2017, 11, 23), Date.civil(2018, 11, 22), Date.civil(2019, 11, 28)].each do |date|
422
+ assert_equal 'Thanksgiving', Holidays.on(date, [:us])[0][:name]
423
+ end
424
+
425
+ states_black_friday =
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
438
+
439
+ states_xmas_eve = %i{us_ar us_mi us_nc us_sc us_tx us_wi}
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]
446
+
447
+ [Date.civil(2021, 12, 27), Date.civil(2022, 12, 26), Date.civil(2027, 12, 27)].each do |date|
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]
452
+
453
+ states_day_after_christmas = %i{us_ar us_nc us_ok us_sc us_tn us_tx}
454
+ assert_equal 'Day after Christmas', Holidays.on(Date.civil(2017, 12, 26), states_day_after_christmas)[0][:name]
455
+
456
+ assert_equal "New Year's Eve", Holidays.on(Date.civil(2017, 12, 31), [:us_mi, :us_wi])[0][:name]
229
457
 
230
458
 
231
459
  {Date.civil(2013,2,2) => 'Groundhog Day',