holidays 6.4.0 → 8.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.gitmodules +1 -1
- data/CHANGELOG.md +80 -0
- data/Makefile +17 -4
- data/README.md +236 -101
- data/Rakefile +1 -1
- data/bin/console +0 -0
- data/bin/setup +1 -0
- data/doc/CONTRIBUTING.md +72 -0
- data/{MAINTAINERS.md → doc/MAINTAINERS.md} +5 -6
- data/{REFERENCES → doc/REFERENCES} +0 -0
- data/holidays.gemspec +8 -9
- data/lib/generated_definitions/MANIFEST +12 -4
- data/lib/generated_definitions/REGIONS.rb +2 -2
- data/lib/generated_definitions/ar.rb +30 -11
- data/lib/generated_definitions/at.rb +2 -2
- data/lib/generated_definitions/au.rb +26 -8
- data/lib/generated_definitions/be_fr.rb +2 -2
- data/lib/generated_definitions/be_nl.rb +2 -2
- data/lib/generated_definitions/bg.rb +2 -2
- data/lib/generated_definitions/br.rb +2 -2
- data/lib/generated_definitions/ca.rb +24 -17
- data/lib/generated_definitions/ch.rb +16 -4
- data/lib/generated_definitions/cl.rb +7 -10
- data/lib/generated_definitions/co.rb +121 -0
- data/lib/generated_definitions/cr.rb +2 -2
- data/lib/generated_definitions/cz.rb +2 -2
- data/lib/generated_definitions/de.rb +8 -5
- data/lib/generated_definitions/dk.rb +2 -2
- data/lib/generated_definitions/{ecb_target.rb → ecbtarget.rb} +10 -10
- data/lib/generated_definitions/ee.rb +2 -2
- data/lib/generated_definitions/el.rb +2 -2
- data/lib/generated_definitions/es.rb +8 -5
- data/lib/generated_definitions/europe.rb +114 -29
- data/lib/generated_definitions/federalreserve.rb +35 -0
- data/lib/generated_definitions/{federal_reserve.rb → federalreservebanks.rb} +15 -14
- data/lib/generated_definitions/fedex.rb +2 -2
- data/lib/generated_definitions/fi.rb +2 -2
- data/lib/generated_definitions/fr.rb +2 -2
- data/lib/generated_definitions/gb.rb +15 -8
- data/lib/generated_definitions/ge.rb +2 -2
- data/lib/generated_definitions/hk.rb +2 -2
- data/lib/generated_definitions/hr.rb +10 -8
- data/lib/generated_definitions/hu.rb +4 -3
- data/lib/generated_definitions/ie.rb +2 -2
- data/lib/generated_definitions/is.rb +2 -2
- data/lib/generated_definitions/it.rb +16 -7
- data/lib/generated_definitions/jp.rb +34 -15
- data/lib/generated_definitions/kr.rb +2 -2
- data/lib/generated_definitions/kz.rb +38 -0
- data/lib/generated_definitions/li.rb +2 -2
- data/lib/generated_definitions/lt.rb +2 -2
- data/lib/generated_definitions/lu.rb +4 -2
- data/lib/generated_definitions/lv.rb +55 -0
- data/lib/generated_definitions/ma.rb +2 -2
- data/lib/generated_definitions/mt_en.rb +2 -2
- data/lib/generated_definitions/mt_mt.rb +2 -2
- data/lib/generated_definitions/mx.rb +7 -7
- data/lib/generated_definitions/my.rb +2 -2
- data/lib/generated_definitions/nerc.rb +2 -2
- data/lib/generated_definitions/ng.rb +33 -0
- data/lib/generated_definitions/nl.rb +2 -2
- data/lib/generated_definitions/no.rb +2 -2
- data/lib/generated_definitions/{north_america.rb → northamerica.rb} +33 -26
- data/lib/generated_definitions/nyse.rb +3 -2
- data/lib/generated_definitions/nz.rb +41 -3
- data/lib/generated_definitions/pe.rb +2 -2
- data/lib/generated_definitions/ph.rb +2 -2
- data/lib/generated_definitions/pl.rb +2 -2
- data/lib/generated_definitions/pt.rb +2 -2
- data/lib/generated_definitions/ro.rb +6 -3
- data/lib/generated_definitions/rs_cyrl.rb +3 -3
- data/lib/generated_definitions/rs_la.rb +3 -3
- data/lib/generated_definitions/ru.rb +2 -2
- data/lib/generated_definitions/scandinavia.rb +2 -2
- data/lib/generated_definitions/se.rb +2 -2
- data/lib/generated_definitions/sg.rb +2 -2
- data/lib/generated_definitions/si.rb +4 -3
- data/lib/generated_definitions/sk.rb +2 -2
- data/lib/generated_definitions/southamerica.rb +247 -0
- data/lib/generated_definitions/th.rb +36 -0
- data/lib/generated_definitions/tn.rb +2 -2
- data/lib/generated_definitions/tr.rb +7 -5
- data/lib/generated_definitions/ua.rb +37 -0
- data/lib/generated_definitions/{united_nations.rb → unitednations.rb} +61 -61
- data/lib/generated_definitions/ups.rb +2 -2
- data/lib/generated_definitions/us.rb +9 -9
- data/lib/generated_definitions/ve.rb +2 -2
- data/lib/generated_definitions/vi.rb +2 -2
- data/lib/generated_definitions/za.rb +3 -3
- data/lib/holidays/core_extensions/time.rb +3 -3
- data/lib/holidays/definition/context/generator.rb +23 -70
- data/lib/holidays/definition/context/load.rb +1 -1
- data/lib/holidays/definition/generator/module.rb +54 -0
- data/lib/holidays/definition/generator/regions.rb +7 -2
- data/lib/holidays/definition/parser/custom_method.rb +2 -2
- data/lib/holidays/definition/repository/cache.rb +2 -1
- data/lib/holidays/definition/repository/holidays_by_month.rb +9 -1
- data/lib/holidays/factory/definition.rb +7 -0
- data/lib/holidays/finder/context/between.rb +6 -7
- data/lib/holidays/finder/context/dates_driver_builder.rb +5 -11
- data/lib/holidays/finder/context/next_holiday.rb +12 -12
- data/lib/holidays/finder/context/parse_options.rb +0 -6
- data/lib/holidays/finder/context/search.rb +39 -32
- data/lib/holidays/finder/rules/year_range.rb +30 -54
- data/lib/holidays/version.rb +1 -1
- data/lib/holidays.rb +14 -7
- data/test/coverage_report.rb +23 -7
- data/test/data/test_custom_informal_holidays_defs.yaml +11 -0
- data/test/data/test_custom_year_range_holiday_defs.yaml +6 -10
- data/test/data/test_multiple_regions_with_conflicts_region_1.yaml +38 -0
- data/test/data/test_multiple_regions_with_conflicts_region_2.yaml +38 -0
- data/test/defs/test_defs_ar.rb +30 -6
- data/test/defs/test_defs_at.rb +5 -3
- data/test/defs/test_defs_au.rb +29 -0
- data/test/defs/test_defs_be_fr.rb +10 -0
- data/test/defs/test_defs_be_nl.rb +10 -0
- data/test/defs/test_defs_ca.rb +63 -8
- data/test/defs/test_defs_ch.rb +6 -0
- data/test/defs/test_defs_co.rb +113 -0
- data/test/defs/test_defs_de.rb +7 -1
- data/test/defs/{test_defs_ecb_target.rb → test_defs_ecbtarget.rb} +11 -11
- data/test/defs/test_defs_es.rb +2 -0
- data/test/defs/test_defs_europe.rb +250 -15
- data/test/defs/test_defs_federalreserve.rb +119 -0
- data/test/defs/test_defs_federalreservebanks.rb +251 -0
- data/test/defs/test_defs_gb.rb +42 -0
- data/test/defs/test_defs_hr.rb +6 -6
- data/test/defs/test_defs_hu.rb +12 -4
- data/test/defs/test_defs_it.rb +20 -0
- data/test/defs/test_defs_jp.rb +30 -2
- data/test/defs/test_defs_kz.rb +39 -0
- data/test/defs/test_defs_lu.rb +6 -0
- data/test/defs/test_defs_lv.rb +96 -0
- data/test/defs/test_defs_mx.rb +3 -1
- data/test/defs/test_defs_ng.rb +29 -0
- data/test/defs/{test_defs_north_america.rb → test_defs_northamerica.rb} +77 -20
- data/test/defs/test_defs_nyse.rb +7 -0
- data/test/defs/test_defs_nz.rb +4 -0
- data/test/defs/test_defs_ro.rb +14 -0
- data/test/defs/test_defs_rs_cyrl.rb +1 -1
- data/test/defs/test_defs_rs_la.rb +1 -1
- data/test/defs/test_defs_southamerica.rb +323 -0
- data/test/defs/test_defs_th.rb +33 -0
- data/test/defs/test_defs_tr.rb +7 -0
- data/test/defs/test_defs_ua.rb +41 -0
- data/test/defs/{test_defs_united_nations.rb → test_defs_unitednations.rb} +3 -3
- data/test/defs/test_defs_us.rb +11 -11
- data/test/holidays/core_extensions/test_date.rb +3 -2
- data/test/holidays/definition/context/test_generator.rb +17 -20
- data/test/holidays/definition/context/test_load.rb +3 -3
- data/test/holidays/definition/generator/test_module.rb +268 -0
- data/test/holidays/definition/parser/test_custom_method.rb +4 -4
- data/test/holidays/definition/repository/test_holidays_by_month.rb +121 -1
- data/test/holidays/finder/context/test_parse_options.rb +0 -10
- data/test/holidays/finder/rules/test_year_range.rb +43 -47
- data/test/integration/test_any_holidays_during_work_week.rb +90 -0
- data/test/integration/test_available_regions.rb +1 -1
- data/test/integration/test_custom_informal_holidays.rb +15 -0
- data/test/integration/test_custom_year_range_holidays.rb +0 -7
- data/test/integration/test_holidays.rb +4 -56
- data/test/integration/test_holidays_between.rb +11 -1
- data/test/integration/test_multiple_regions.rb +54 -6
- data/test/integration/test_multiple_regions_with_conflict.rb +29 -0
- data/test/integration/test_nonstandard_regions.rb +25 -0
- metadata +79 -53
- data/CONTRIBUTING.md +0 -51
- data/test/defs/test_defs_federal_reserve.rb +0 -111
data/test/defs/test_defs_ca.rb
CHANGED
@@ -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/
|
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), [:
|
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(
|
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 "
|
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
|
-
|
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(
|
220
|
+
assert_equal "Christmas Day", (Holidays.on(Date.civil(2010, 12, 24), [:ca_on], [:observed])[0] || {})[:name]
|
193
221
|
|
194
|
-
assert_equal "
|
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]
|
data/test/defs/test_defs_ch.rb
CHANGED
@@ -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
|
data/test/defs/test_defs_de.rb
CHANGED
@@ -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(
|
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/
|
7
|
-
class
|
6
|
+
# Definitions loaded: definitions/ecbtarget.yaml
|
7
|
+
class EcbtargetDefinitionTests < Test::Unit::TestCase # :nodoc:
|
8
8
|
|
9
|
-
def
|
10
|
-
assert_equal "New Year's Day", (Holidays.on(Date.civil(2013, 1, 1), [:
|
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), [:
|
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), [:
|
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), [:
|
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), [:
|
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), [:
|
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), [:
|
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), [:
|
24
|
+
assert_equal "Easter Monday", (Holidays.on(Date.civil(2013, 4, 1), [:ecbtarget])[0] || {})[:name]
|
25
25
|
|
26
26
|
end
|
27
27
|
end
|
data/test/defs/test_defs_es.rb
CHANGED
@@ -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
|