holidays 6.4.0 → 8.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (168) hide show
  1. checksums.yaml +5 -5
  2. data/.gitmodules +1 -1
  3. data/CHANGELOG.md +80 -0
  4. data/Makefile +17 -4
  5. data/README.md +236 -101
  6. data/Rakefile +1 -1
  7. data/bin/console +0 -0
  8. data/bin/setup +1 -0
  9. data/doc/CONTRIBUTING.md +72 -0
  10. data/{MAINTAINERS.md → doc/MAINTAINERS.md} +5 -6
  11. data/{REFERENCES → doc/REFERENCES} +0 -0
  12. data/holidays.gemspec +8 -9
  13. data/lib/generated_definitions/MANIFEST +12 -4
  14. data/lib/generated_definitions/REGIONS.rb +2 -2
  15. data/lib/generated_definitions/ar.rb +30 -11
  16. data/lib/generated_definitions/at.rb +2 -2
  17. data/lib/generated_definitions/au.rb +26 -8
  18. data/lib/generated_definitions/be_fr.rb +2 -2
  19. data/lib/generated_definitions/be_nl.rb +2 -2
  20. data/lib/generated_definitions/bg.rb +2 -2
  21. data/lib/generated_definitions/br.rb +2 -2
  22. data/lib/generated_definitions/ca.rb +24 -17
  23. data/lib/generated_definitions/ch.rb +16 -4
  24. data/lib/generated_definitions/cl.rb +7 -10
  25. data/lib/generated_definitions/co.rb +121 -0
  26. data/lib/generated_definitions/cr.rb +2 -2
  27. data/lib/generated_definitions/cz.rb +2 -2
  28. data/lib/generated_definitions/de.rb +8 -5
  29. data/lib/generated_definitions/dk.rb +2 -2
  30. data/lib/generated_definitions/{ecb_target.rb → ecbtarget.rb} +10 -10
  31. data/lib/generated_definitions/ee.rb +2 -2
  32. data/lib/generated_definitions/el.rb +2 -2
  33. data/lib/generated_definitions/es.rb +8 -5
  34. data/lib/generated_definitions/europe.rb +114 -29
  35. data/lib/generated_definitions/federalreserve.rb +35 -0
  36. data/lib/generated_definitions/{federal_reserve.rb → federalreservebanks.rb} +15 -14
  37. data/lib/generated_definitions/fedex.rb +2 -2
  38. data/lib/generated_definitions/fi.rb +2 -2
  39. data/lib/generated_definitions/fr.rb +2 -2
  40. data/lib/generated_definitions/gb.rb +15 -8
  41. data/lib/generated_definitions/ge.rb +2 -2
  42. data/lib/generated_definitions/hk.rb +2 -2
  43. data/lib/generated_definitions/hr.rb +10 -8
  44. data/lib/generated_definitions/hu.rb +4 -3
  45. data/lib/generated_definitions/ie.rb +2 -2
  46. data/lib/generated_definitions/is.rb +2 -2
  47. data/lib/generated_definitions/it.rb +16 -7
  48. data/lib/generated_definitions/jp.rb +34 -15
  49. data/lib/generated_definitions/kr.rb +2 -2
  50. data/lib/generated_definitions/kz.rb +38 -0
  51. data/lib/generated_definitions/li.rb +2 -2
  52. data/lib/generated_definitions/lt.rb +2 -2
  53. data/lib/generated_definitions/lu.rb +4 -2
  54. data/lib/generated_definitions/lv.rb +55 -0
  55. data/lib/generated_definitions/ma.rb +2 -2
  56. data/lib/generated_definitions/mt_en.rb +2 -2
  57. data/lib/generated_definitions/mt_mt.rb +2 -2
  58. data/lib/generated_definitions/mx.rb +7 -7
  59. data/lib/generated_definitions/my.rb +2 -2
  60. data/lib/generated_definitions/nerc.rb +2 -2
  61. data/lib/generated_definitions/ng.rb +33 -0
  62. data/lib/generated_definitions/nl.rb +2 -2
  63. data/lib/generated_definitions/no.rb +2 -2
  64. data/lib/generated_definitions/{north_america.rb → northamerica.rb} +33 -26
  65. data/lib/generated_definitions/nyse.rb +3 -2
  66. data/lib/generated_definitions/nz.rb +41 -3
  67. data/lib/generated_definitions/pe.rb +2 -2
  68. data/lib/generated_definitions/ph.rb +2 -2
  69. data/lib/generated_definitions/pl.rb +2 -2
  70. data/lib/generated_definitions/pt.rb +2 -2
  71. data/lib/generated_definitions/ro.rb +6 -3
  72. data/lib/generated_definitions/rs_cyrl.rb +3 -3
  73. data/lib/generated_definitions/rs_la.rb +3 -3
  74. data/lib/generated_definitions/ru.rb +2 -2
  75. data/lib/generated_definitions/scandinavia.rb +2 -2
  76. data/lib/generated_definitions/se.rb +2 -2
  77. data/lib/generated_definitions/sg.rb +2 -2
  78. data/lib/generated_definitions/si.rb +4 -3
  79. data/lib/generated_definitions/sk.rb +2 -2
  80. data/lib/generated_definitions/southamerica.rb +247 -0
  81. data/lib/generated_definitions/th.rb +36 -0
  82. data/lib/generated_definitions/tn.rb +2 -2
  83. data/lib/generated_definitions/tr.rb +7 -5
  84. data/lib/generated_definitions/ua.rb +37 -0
  85. data/lib/generated_definitions/{united_nations.rb → unitednations.rb} +61 -61
  86. data/lib/generated_definitions/ups.rb +2 -2
  87. data/lib/generated_definitions/us.rb +9 -9
  88. data/lib/generated_definitions/ve.rb +2 -2
  89. data/lib/generated_definitions/vi.rb +2 -2
  90. data/lib/generated_definitions/za.rb +3 -3
  91. data/lib/holidays/core_extensions/time.rb +3 -3
  92. data/lib/holidays/definition/context/generator.rb +23 -70
  93. data/lib/holidays/definition/context/load.rb +1 -1
  94. data/lib/holidays/definition/generator/module.rb +54 -0
  95. data/lib/holidays/definition/generator/regions.rb +7 -2
  96. data/lib/holidays/definition/parser/custom_method.rb +2 -2
  97. data/lib/holidays/definition/repository/cache.rb +2 -1
  98. data/lib/holidays/definition/repository/holidays_by_month.rb +9 -1
  99. data/lib/holidays/factory/definition.rb +7 -0
  100. data/lib/holidays/finder/context/between.rb +6 -7
  101. data/lib/holidays/finder/context/dates_driver_builder.rb +5 -11
  102. data/lib/holidays/finder/context/next_holiday.rb +12 -12
  103. data/lib/holidays/finder/context/parse_options.rb +0 -6
  104. data/lib/holidays/finder/context/search.rb +39 -32
  105. data/lib/holidays/finder/rules/year_range.rb +30 -54
  106. data/lib/holidays/version.rb +1 -1
  107. data/lib/holidays.rb +14 -7
  108. data/test/coverage_report.rb +23 -7
  109. data/test/data/test_custom_informal_holidays_defs.yaml +11 -0
  110. data/test/data/test_custom_year_range_holiday_defs.yaml +6 -10
  111. data/test/data/test_multiple_regions_with_conflicts_region_1.yaml +38 -0
  112. data/test/data/test_multiple_regions_with_conflicts_region_2.yaml +38 -0
  113. data/test/defs/test_defs_ar.rb +30 -6
  114. data/test/defs/test_defs_at.rb +5 -3
  115. data/test/defs/test_defs_au.rb +29 -0
  116. data/test/defs/test_defs_be_fr.rb +10 -0
  117. data/test/defs/test_defs_be_nl.rb +10 -0
  118. data/test/defs/test_defs_ca.rb +63 -8
  119. data/test/defs/test_defs_ch.rb +6 -0
  120. data/test/defs/test_defs_co.rb +113 -0
  121. data/test/defs/test_defs_de.rb +7 -1
  122. data/test/defs/{test_defs_ecb_target.rb → test_defs_ecbtarget.rb} +11 -11
  123. data/test/defs/test_defs_es.rb +2 -0
  124. data/test/defs/test_defs_europe.rb +250 -15
  125. data/test/defs/test_defs_federalreserve.rb +119 -0
  126. data/test/defs/test_defs_federalreservebanks.rb +251 -0
  127. data/test/defs/test_defs_gb.rb +42 -0
  128. data/test/defs/test_defs_hr.rb +6 -6
  129. data/test/defs/test_defs_hu.rb +12 -4
  130. data/test/defs/test_defs_it.rb +20 -0
  131. data/test/defs/test_defs_jp.rb +30 -2
  132. data/test/defs/test_defs_kz.rb +39 -0
  133. data/test/defs/test_defs_lu.rb +6 -0
  134. data/test/defs/test_defs_lv.rb +96 -0
  135. data/test/defs/test_defs_mx.rb +3 -1
  136. data/test/defs/test_defs_ng.rb +29 -0
  137. data/test/defs/{test_defs_north_america.rb → test_defs_northamerica.rb} +77 -20
  138. data/test/defs/test_defs_nyse.rb +7 -0
  139. data/test/defs/test_defs_nz.rb +4 -0
  140. data/test/defs/test_defs_ro.rb +14 -0
  141. data/test/defs/test_defs_rs_cyrl.rb +1 -1
  142. data/test/defs/test_defs_rs_la.rb +1 -1
  143. data/test/defs/test_defs_southamerica.rb +323 -0
  144. data/test/defs/test_defs_th.rb +33 -0
  145. data/test/defs/test_defs_tr.rb +7 -0
  146. data/test/defs/test_defs_ua.rb +41 -0
  147. data/test/defs/{test_defs_united_nations.rb → test_defs_unitednations.rb} +3 -3
  148. data/test/defs/test_defs_us.rb +11 -11
  149. data/test/holidays/core_extensions/test_date.rb +3 -2
  150. data/test/holidays/definition/context/test_generator.rb +17 -20
  151. data/test/holidays/definition/context/test_load.rb +3 -3
  152. data/test/holidays/definition/generator/test_module.rb +268 -0
  153. data/test/holidays/definition/parser/test_custom_method.rb +4 -4
  154. data/test/holidays/definition/repository/test_holidays_by_month.rb +121 -1
  155. data/test/holidays/finder/context/test_parse_options.rb +0 -10
  156. data/test/holidays/finder/rules/test_year_range.rb +43 -47
  157. data/test/integration/test_any_holidays_during_work_week.rb +90 -0
  158. data/test/integration/test_available_regions.rb +1 -1
  159. data/test/integration/test_custom_informal_holidays.rb +15 -0
  160. data/test/integration/test_custom_year_range_holidays.rb +0 -7
  161. data/test/integration/test_holidays.rb +4 -56
  162. data/test/integration/test_holidays_between.rb +11 -1
  163. data/test/integration/test_multiple_regions.rb +54 -6
  164. data/test/integration/test_multiple_regions_with_conflict.rb +29 -0
  165. data/test/integration/test_nonstandard_regions.rb +25 -0
  166. metadata +79 -53
  167. data/CONTRIBUTING.md +0 -51
  168. data/test/defs/test_defs_federal_reserve.rb +0 -111
@@ -3,7 +3,7 @@ require File.expand_path(File.dirname(__FILE__)) + '/../test_helper'
3
3
 
4
4
  # This file is generated by the Ruby Holiday gem.
5
5
  #
6
- # Definitions loaded: definitions/ca.yaml, definitions/north_america_informal.yaml
6
+ # Definitions loaded: definitions/ca.yaml, definitions/northamericainformal.yaml
7
7
  class CaDefinitionTests < Test::Unit::TestCase # :nodoc:
8
8
 
9
9
  def test_ca
@@ -19,7 +19,7 @@ class CaDefinitionTests < Test::Unit::TestCase # :nodoc:
19
19
 
20
20
  assert_equal "Labour Day", (Holidays.on(Date.civil(2008, 9, 1), [:ca], [:informal])[0] || {})[:name]
21
21
 
22
- assert_equal "Christmas Day", (Holidays.on(Date.civil(2008, 12, 25), [:ca], [:informal])[0] || {})[:name]
22
+ assert_equal "Christmas Day", (Holidays.on(Date.civil(2008, 12, 25), [:ca_on], [:informal])[0] || {})[:name]
23
23
 
24
24
  assert_equal "Family Day", (Holidays.on(Date.civil(1990, 2, 19), [:ca_ab])[0] || {})[:name]
25
25
 
@@ -73,7 +73,7 @@ class CaDefinitionTests < Test::Unit::TestCase # :nodoc:
73
73
 
74
74
  assert_equal "Family Day", (Holidays.on(Date.civil(2014, 2, 10), [:ca_bc])[0] || {})[:name]
75
75
 
76
- assert_equal "Family Day", (Holidays.on(Date.civil(2044, 2, 8), [:ca_bc])[0] || {})[:name]
76
+ assert_equal "Family Day", (Holidays.on(Date.civil(2018, 2, 12), [:ca_bc])[0] || {})[:name]
77
77
 
78
78
  assert_nil (Holidays.on(Date.civil(2000, 2, 14), [:ca_bc])[0] || {})[:name]
79
79
 
@@ -81,6 +81,22 @@ class CaDefinitionTests < Test::Unit::TestCase # :nodoc:
81
81
 
82
82
  assert_nil (Holidays.on(Date.civil(2012, 2, 13), [:ca_bc])[0] || {})[:name]
83
83
 
84
+ assert_nil (Holidays.on(Date.civil(2019, 2, 11), [:ca_bc])[0] || {})[:name]
85
+
86
+ assert_nil (Holidays.on(Date.civil(2044, 2, 8), [:ca_bc])[0] || {})[:name]
87
+
88
+ assert_equal "Family Day", (Holidays.on(Date.civil(2019, 2, 18), [:ca_bc])[0] || {})[:name]
89
+
90
+ assert_equal "Family Day", (Holidays.on(Date.civil(2020, 2, 17), [:ca_bc])[0] || {})[:name]
91
+
92
+ assert_equal "Family Day", (Holidays.on(Date.civil(2044, 2, 15), [:ca_bc])[0] || {})[:name]
93
+
94
+ assert_nil (Holidays.on(Date.civil(2000, 2, 21), [:ca_bc])[0] || {})[:name]
95
+
96
+ assert_nil (Holidays.on(Date.civil(2011, 2, 21), [:ca_bc])[0] || {})[:name]
97
+
98
+ assert_nil (Holidays.on(Date.civil(2018, 2, 19), [:ca_bc])[0] || {})[:name]
99
+
84
100
  assert_equal "Family Day", (Holidays.on(Date.civil(2018, 2, 19), [:ca_nb])[0] || {})[:name]
85
101
 
86
102
  assert_equal "Family Day", (Holidays.on(Date.civil(2019, 2, 18), [:ca_nb])[0] || {})[:name]
@@ -185,16 +201,37 @@ assert_equal "Remembrance Day", (Holidays.on(Date.civil(2017, 11, 13), [:ca_ab,
185
201
 
186
202
  assert_equal "Canada Day", (Holidays.on(Date.civil(2017, 7, 3), [:ca], [:observed])[0] || {})[:name]
187
203
 
188
- assert_equal "Christmas Day", (Holidays.on(Date.civil(2010, 12, 27), [:ca], [:observed])[0] || {})[:name]
204
+ assert_equal "National Day for Truth and Reconciliation", (Holidays.on(Date.civil(2021, 9, 30), [:ca])[0] || {})[:name]
205
+
206
+ assert_equal "National Day for Truth and Reconciliation", (Holidays.on(Date.civil(2026, 9, 30), [:ca])[0] || {})[:name]
207
+
208
+ assert_nil (Holidays.on(Date.civil(2020, 9, 30), [:ca])[0] || {})[:name]
209
+
210
+ assert_nil (Holidays.on(Date.civil(1985, 9, 30), [:ca])[0] || {})[:name]
211
+
212
+ assert_equal "Christmas Day", (Holidays.on(Date.civil(2010, 12, 25), [:ca_on])[0] || {})[:name]
213
+
214
+ assert_equal "Christmas Day", (Holidays.on(Date.civil(2018, 12, 25), [:ca_on])[0] || {})[:name]
215
+
216
+ assert_equal "Christmas Day", (Holidays.on(Date.civil(2022, 12, 25), [:ca_on])[0] || {})[:name]
189
217
 
190
- assert_equal "Christmas Day", (Holidays.on(Date.civil(2012, 12, 25), [:ca], [:observed])[0] || {})[:name]
218
+ assert_nil (Holidays.on(Date.civil(2022, 12, 25), [:ca], [:observed])[0] || {})[:name]
191
219
 
192
- assert_equal "Christmas Day", (Holidays.on(Date.civil(2016, 12, 26), [:ca], [:observed])[0] || {})[:name]
220
+ assert_equal "Christmas Day", (Holidays.on(Date.civil(2010, 12, 24), [:ca_on], [:observed])[0] || {})[:name]
193
221
 
194
- assert_equal "Boxing Day", (Holidays.on(Date.civil(2010, 12, 28), [:ca_on], [:observed])[0] || {})[:name]
222
+ assert_equal "Christmas Day", (Holidays.on(Date.civil(2012, 12, 25), [:ca_on], [:observed])[0] || {})[:name]
223
+
224
+ assert_equal "Christmas Day", (Holidays.on(Date.civil(2016, 12, 26), [:ca_on], [:observed])[0] || {})[:name]
225
+
226
+ assert_equal "Christmas Day", (Holidays.on(Date.civil(2021, 12, 24), [:ca_ab, :ca_bc, :ca_mb, :ca_nb, :ca_nl, :ca_nt, :ca_ns, :ca_nu, :ca_pe, :ca_qc, :ca_sk, :ca_yt], [:observed])[0] || {})[:name]
227
+
228
+ assert_equal "Christmas Day", (Holidays.on(Date.civil(2021, 12, 27), [:ca_on], [:observed])[0] || {})[:name]
229
+
230
+ assert_equal "Christmas Day", (Holidays.on(Date.civil(2022, 12, 26), [:ca_on], [:observed])[0] || {})[:name]
231
+
232
+ assert_equal "Boxing Day", (Holidays.on(Date.civil(2010, 12, 27), [:ca_on], [:observed])[0] || {})[:name]
195
233
  assert_equal "Boxing Day", (Holidays.on(Date.civil(2012, 12, 26), [:ca_on], [:observed])[0] || {})[:name]
196
234
  assert_equal "Boxing Day", (Holidays.on(Date.civil(2015, 12, 28), [:ca_on], [:observed])[0] || {})[:name]
197
- assert_equal "Boxing Day", (Holidays.on(Date.civil(2016, 12, 27), [:ca_on], [:observed])[0] || {})[:name]
198
235
 
199
236
  assert_nil (Holidays.on(Date.civil(2015, 6, 21), [:ca_yt])[0] || {})[:name]
200
237
 
@@ -204,6 +241,24 @@ assert_equal "Boxing Day", (Holidays.on(Date.civil(2016, 12, 27), [:ca_on], [:ob
204
241
 
205
242
  assert_equal "National Aboriginal Day", (Holidays.on(Date.civil(2018, 6, 21), [:ca_yt])[0] || {})[:name]
206
243
 
244
+ assert_equal "Terry Fox Day", (Holidays.on(Date.civil(2019, 8, 5), [:ca_mb], [:informal])[0] || {})[:name]
245
+
246
+ assert_equal "Terry Fox Day", (Holidays.on(Date.civil(2020, 8, 3), [:ca_mb], [:informal])[0] || {})[:name]
247
+
248
+ assert_nil (Holidays.on(Date.civil(2020, 8, 3), [:ca_mb])[0] || {})[:name]
249
+
250
+ assert_equal "Terry Fox Day", (Holidays.on(Date.civil(2015, 8, 3), [:ca_mb], [:informal])[0] || {})[:name]
251
+
252
+ assert_equal "Terry Fox Day", (Holidays.on(Date.civil(2045, 8, 7), [:ca_mb], [:informal])[0] || {})[:name]
253
+
254
+ assert_equal "Nunavut Day", (Holidays.on(Date.civil(2020, 7, 9), [:ca_nu])[0] || {})[:name]
255
+
256
+ assert_equal "Nunavut Day", (Holidays.on(Date.civil(2021, 7, 9), [:ca_nu])[0] || {})[:name]
257
+
258
+ assert_nil (Holidays.on(Date.civil(2019, 7, 9), [:ca_nu])[0] || {})[:name]
259
+
260
+ assert_nil (Holidays.on(Date.civil(2018, 7, 9), [:ca_nu])[0] || {})[:name]
261
+
207
262
  assert_equal "Groundhog Day", (Holidays.on(Date.civil(2013, 2, 2), [:us], [:informal])[0] || {})[:name]
208
263
 
209
264
  assert_equal "Valentine's Day", (Holidays.on(Date.civil(2013, 2, 14), [:us], [:informal])[0] || {})[:name]
@@ -7,6 +7,8 @@ require File.expand_path(File.dirname(__FILE__)) + '/../test_helper'
7
7
  class ChDefinitionTests < Test::Unit::TestCase # :nodoc:
8
8
 
9
9
  def test_ch
10
+ assert_equal "Neujahrstag", (Holidays.on(Date.civil(2018, 1, 1), [:ch])[0] || {})[:name]
11
+
10
12
  assert_equal "Bundesfeiertag", (Holidays.on(Date.civil(2012, 8, 1), [:ch])[0] || {})[:name]
11
13
 
12
14
  assert_equal "Weihnachten", (Holidays.on(Date.civil(2012, 12, 25), [:ch])[0] || {})[:name]
@@ -41,5 +43,9 @@ class ChDefinitionTests < Test::Unit::TestCase # :nodoc:
41
43
 
42
44
  assert_equal "Näfelser Fahrt", (Holidays.on(Date.civil(2014, 4, 3), [:ch_gl])[0] || {})[:name]
43
45
 
46
+ assert_equal "Zibelemärit", (Holidays.on(Date.civil(2014, 11, 24), [:ch_be])[0] || {})[:name]
47
+
48
+ assert_equal "Zibelemärit", (Holidays.on(Date.civil(2020, 11, 23), [:ch_be])[0] || {})[:name]
49
+
44
50
  end
45
51
  end
@@ -0,0 +1,113 @@
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/co.yaml
7
+ class CoDefinitionTests < Test::Unit::TestCase # :nodoc:
8
+
9
+ def test_co
10
+ assert_equal "Año Nuevo", (Holidays.on(Date.civil(2014, 1, 1), [:co])[0] || {})[:name]
11
+
12
+ assert_equal "Año Nuevo", (Holidays.on(Date.civil(2017, 1, 1), [:co])[0] || {})[:name]
13
+
14
+ assert_equal "Día de los Reyes Magos", (Holidays.on(Date.civil(2014, 1, 6), [:co])[0] || {})[:name]
15
+
16
+ assert_equal "Día de los Reyes Magos", (Holidays.on(Date.civil(2015, 1, 12), [:co])[0] || {})[:name]
17
+
18
+ assert_equal "Día de los Reyes Magos", (Holidays.on(Date.civil(2017, 1, 9), [:co])[0] || {})[:name]
19
+
20
+ assert_equal "Día de San José", (Holidays.on(Date.civil(2014, 3, 24), [:co])[0] || {})[:name]
21
+
22
+ assert_equal "Día de San José", (Holidays.on(Date.civil(2017, 3, 20), [:co])[0] || {})[:name]
23
+
24
+ assert_equal "Día de San José", (Holidays.on(Date.civil(2018, 3, 19), [:co])[0] || {})[:name]
25
+
26
+ assert_equal "Jueves Santo", (Holidays.on(Date.civil(2015, 4, 2), [:co])[0] || {})[:name]
27
+
28
+ assert_equal "Jueves Santo", (Holidays.on(Date.civil(2017, 4, 13), [:co])[0] || {})[:name]
29
+
30
+ assert_equal "Jueves Santo", (Holidays.on(Date.civil(2018, 3, 29), [:co])[0] || {})[:name]
31
+
32
+ assert_equal "Viernes Santo", (Holidays.on(Date.civil(2014, 4, 18), [:co])[0] || {})[:name]
33
+
34
+ assert_equal "Viernes Santo", (Holidays.on(Date.civil(2016, 3, 25), [:co])[0] || {})[:name]
35
+
36
+ assert_equal "Viernes Santo", (Holidays.on(Date.civil(2018, 3, 30), [:co])[0] || {})[:name]
37
+
38
+ assert_equal "Día del Trabajo", (Holidays.on(Date.civil(2013, 5, 1), [:co])[0] || {})[:name]
39
+
40
+ assert_equal "Día del Trabajo", (Holidays.on(Date.civil(2016, 5, 1), [:co])[0] || {})[:name]
41
+
42
+ assert_equal "Día de la Ascensión", (Holidays.on(Date.civil(2014, 6, 2), [:co])[0] || {})[:name]
43
+
44
+ assert_equal "Día de la Ascensión", (Holidays.on(Date.civil(2016, 5, 9), [:co])[0] || {})[:name]
45
+
46
+ assert_equal "Día de la Ascensión", (Holidays.on(Date.civil(2017, 5, 29), [:co])[0] || {})[:name]
47
+
48
+ assert_equal "Corpus Christi", (Holidays.on(Date.civil(2014, 6, 23), [:co])[0] || {})[:name]
49
+
50
+ assert_equal "Corpus Christi", (Holidays.on(Date.civil(2016, 5, 30), [:co])[0] || {})[:name]
51
+
52
+ assert_equal "Corpus Christi", (Holidays.on(Date.civil(2017, 6, 19), [:co])[0] || {})[:name]
53
+
54
+ assert_equal "Sagrado Corazón", (Holidays.on(Date.civil(2014, 6, 30), [:co])[0] || {})[:name]
55
+
56
+ assert_equal "Sagrado Corazón", (Holidays.on(Date.civil(2016, 6, 6), [:co])[0] || {})[:name]
57
+
58
+ assert_equal "Sagrado Corazón", (Holidays.on(Date.civil(2017, 6, 26), [:co])[0] || {})[:name]
59
+
60
+ assert_equal "San Pedro y San Pablo", (Holidays.on(Date.civil(2016, 7, 4), [:co])[0] || {})[:name]
61
+
62
+ assert_equal "San Pedro y San Pablo", (Holidays.on(Date.civil(2017, 7, 3), [:co])[0] || {})[:name]
63
+
64
+ assert_equal "Día de la Independencia", (Holidays.on(Date.civil(2014, 7, 20), [:co])[0] || {})[:name]
65
+
66
+ assert_equal "Día de la Independencia", (Holidays.on(Date.civil(2016, 7, 20), [:co])[0] || {})[:name]
67
+
68
+ assert_equal "Día de la Independencia", (Holidays.on(Date.civil(2018, 7, 20), [:co])[0] || {})[:name]
69
+
70
+ assert_equal "Batalla de Boyacá", (Holidays.on(Date.civil(2014, 8, 7), [:co])[0] || {})[:name]
71
+
72
+ assert_equal "Batalla de Boyacá", (Holidays.on(Date.civil(2016, 8, 7), [:co])[0] || {})[:name]
73
+
74
+ assert_equal "Batalla de Boyacá", (Holidays.on(Date.civil(2018, 8, 7), [:co])[0] || {})[:name]
75
+
76
+ assert_equal "La Asunción de la Virgen", (Holidays.on(Date.civil(2014, 8, 18), [:co])[0] || {})[:name]
77
+
78
+ assert_equal "La Asunción de la Virgen", (Holidays.on(Date.civil(2016, 8, 15), [:co])[0] || {})[:name]
79
+
80
+ assert_equal "La Asunción de la Virgen", (Holidays.on(Date.civil(2017, 8, 21), [:co])[0] || {})[:name]
81
+
82
+ assert_equal "Día de la Raza", (Holidays.on(Date.civil(2014, 10, 13), [:co])[0] || {})[:name]
83
+
84
+ assert_equal "Día de la Raza", (Holidays.on(Date.civil(2016, 10, 17), [:co])[0] || {})[:name]
85
+
86
+ assert_equal "Día de la Raza", (Holidays.on(Date.civil(2017, 10, 16), [:co])[0] || {})[:name]
87
+
88
+ assert_equal "Día de Todos los Santos", (Holidays.on(Date.civil(2014, 11, 3), [:co])[0] || {})[:name]
89
+
90
+ assert_equal "Día de Todos los Santos", (Holidays.on(Date.civil(2016, 11, 7), [:co])[0] || {})[:name]
91
+
92
+ assert_equal "Día de Todos los Santos", (Holidays.on(Date.civil(2017, 11, 6), [:co])[0] || {})[:name]
93
+
94
+ assert_equal "Independencia de Cartagena", (Holidays.on(Date.civil(2014, 11, 17), [:co])[0] || {})[:name]
95
+
96
+ assert_equal "Independencia de Cartagena", (Holidays.on(Date.civil(2016, 11, 14), [:co])[0] || {})[:name]
97
+
98
+ assert_equal "Independencia de Cartagena", (Holidays.on(Date.civil(2017, 11, 13), [:co])[0] || {})[:name]
99
+
100
+ assert_equal "Día de la Inmaculada Concepción", (Holidays.on(Date.civil(2013, 12, 8), [:co])[0] || {})[:name]
101
+
102
+ assert_equal "Día de la Inmaculada Concepción", (Holidays.on(Date.civil(2014, 12, 8), [:co])[0] || {})[:name]
103
+
104
+ assert_equal "Día de la Inmaculada Concepción", (Holidays.on(Date.civil(2016, 12, 8), [:co])[0] || {})[:name]
105
+
106
+ assert_equal "Navidad", (Holidays.on(Date.civil(2014, 12, 25), [:co])[0] || {})[:name]
107
+
108
+ assert_equal "Navidad", (Holidays.on(Date.civil(2016, 12, 25), [:co])[0] || {})[:name]
109
+
110
+ assert_equal "Navidad", (Holidays.on(Date.civil(2017, 12, 25), [:co])[0] || {})[:name]
111
+
112
+ end
113
+ end
@@ -49,7 +49,7 @@ class DeDefinitionTests < Test::Unit::TestCase # :nodoc:
49
49
 
50
50
  assert_nil (Holidays.on(Date.civil(2018, 10, 31), [:de])[0] || {})[:name]
51
51
 
52
- assert_equal "Reformationstag", (Holidays.on(Date.civil(2019, 10, 31), [:de_bb, :de_mv, :de_sn, :de_st, :de_th])[0] || {})[:name]
52
+ assert_equal "Reformationstag", (Holidays.on(Date.civil(2018, 10, 31), [:de_bb, :de_hb, :de_hh, :de_mv, :de_ni, :de_sh, :de_sn, :de_st, :de_th])[0] || {})[:name]
53
53
 
54
54
  assert_equal "Allerheiligen", (Holidays.on(Date.civil(2009, 11, 1), [:de_bw, :de_by, :de_nw, :de_rp, :de_sl, :de_])[0] || {})[:name]
55
55
 
@@ -75,5 +75,11 @@ class DeDefinitionTests < Test::Unit::TestCase # :nodoc:
75
75
 
76
76
  assert_equal "Aschermittwoch", (Holidays.on(Date.civil(2016, 2, 10), [:de_bw, :de_by, :de_he, :de_nw, :de_rp, :de_sl, :de_sn], [:informal])[0] || {})[:name]
77
77
 
78
+ assert_nil (Holidays.on(Date.civil(2018, 3, 8), [:de_be])[0] || {})[:name]
79
+
80
+ assert_equal "Internationaler Frauentag", (Holidays.on(Date.civil(2019, 3, 8), [:de_be])[0] || {})[:name]
81
+
82
+ assert_equal "Tag der Befreiung", (Holidays.on(Date.civil(2020, 5, 8), [:de_be])[0] || {})[:name]
83
+
78
84
  end
79
85
  end
@@ -3,25 +3,25 @@ require File.expand_path(File.dirname(__FILE__)) + '/../test_helper'
3
3
 
4
4
  # This file is generated by the Ruby Holiday gem.
5
5
  #
6
- # Definitions loaded: definitions/ecb_target.yaml
7
- class Ecb_targetDefinitionTests < Test::Unit::TestCase # :nodoc:
6
+ # Definitions loaded: definitions/ecbtarget.yaml
7
+ class EcbtargetDefinitionTests < Test::Unit::TestCase # :nodoc:
8
8
 
9
- def test_ecb_target
10
- assert_equal "New Year's Day", (Holidays.on(Date.civil(2013, 1, 1), [:ecb_target])[0] || {})[:name]
9
+ def test_ecbtarget
10
+ assert_equal "New Year's Day", (Holidays.on(Date.civil(2013, 1, 1), [:ecbtarget])[0] || {})[:name]
11
11
 
12
- assert_equal "Labour Day", (Holidays.on(Date.civil(2013, 5, 1), [:ecb_target])[0] || {})[:name]
12
+ assert_equal "Labour Day", (Holidays.on(Date.civil(2013, 5, 1), [:ecbtarget])[0] || {})[:name]
13
13
 
14
- assert_equal "Good Friday", (Holidays.on(Date.civil(2013, 3, 29), [:ecb_target])[0] || {})[:name]
14
+ assert_equal "Good Friday", (Holidays.on(Date.civil(2013, 3, 29), [:ecbtarget])[0] || {})[:name]
15
15
 
16
- assert_equal "Easter Monday", (Holidays.on(Date.civil(2013, 4, 1), [:ecb_target])[0] || {})[:name]
16
+ assert_equal "Easter Monday", (Holidays.on(Date.civil(2013, 4, 1), [:ecbtarget])[0] || {})[:name]
17
17
 
18
- assert_equal "Christmas Day", (Holidays.on(Date.civil(2013, 12, 25), [:ecb_target])[0] || {})[:name]
18
+ assert_equal "Christmas Day", (Holidays.on(Date.civil(2013, 12, 25), [:ecbtarget])[0] || {})[:name]
19
19
 
20
- assert_equal "Christmas Holiday", (Holidays.on(Date.civil(2013, 12, 26), [:ecb_target])[0] || {})[:name]
20
+ assert_equal "Christmas Holiday", (Holidays.on(Date.civil(2013, 12, 26), [:ecbtarget])[0] || {})[:name]
21
21
 
22
- assert_equal "Good Friday", (Holidays.on(Date.civil(2013, 3, 29), [:ecb_target])[0] || {})[:name]
22
+ assert_equal "Good Friday", (Holidays.on(Date.civil(2013, 3, 29), [:ecbtarget])[0] || {})[:name]
23
23
 
24
- assert_equal "Easter Monday", (Holidays.on(Date.civil(2013, 4, 1), [:ecb_target])[0] || {})[:name]
24
+ assert_equal "Easter Monday", (Holidays.on(Date.civil(2013, 4, 1), [:ecbtarget])[0] || {})[:name]
25
25
 
26
26
  end
27
27
  end
@@ -131,5 +131,7 @@ class EsDefinitionTests < Test::Unit::TestCase # :nodoc:
131
131
 
132
132
  assert_equal "Fiesta Nacional de Cataluña", (Holidays.on(Date.civil(2009, 9, 11), [:es_ct])[0] || {})[:name]
133
133
 
134
+ assert_equal "Lunes de Pascua Granada", (Holidays.on(Date.civil(2020, 6, 1), [:es_ct])[0] || {})[:name]
135
+
134
136
  end
135
137
  end