holidays 2.2.0 → 3.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +11 -0
- data/README.md +22 -8
- data/Rakefile +26 -8
- data/bin/console +7 -0
- data/bin/setup +5 -0
- data/{data → definitions}/SYNTAX.rdoc +0 -0
- data/{data → definitions}/ar.yaml +0 -0
- data/{data → definitions}/at.yaml +1 -1
- data/{data → definitions}/au.yaml +80 -51
- data/{data → definitions}/be.yaml +0 -0
- data/{data → definitions}/br.yaml +0 -0
- data/{data → definitions}/ca.yaml +0 -0
- data/{data → definitions}/ch.yaml +0 -0
- data/{data → definitions}/cl.yaml +0 -0
- data/{data → definitions}/cr.yaml +0 -0
- data/{data → definitions}/cz.yaml +0 -0
- data/{data → definitions}/de.yaml +25 -34
- data/{data → definitions}/dk.yaml +0 -0
- data/{data → definitions}/ecb_target.yaml +2 -2
- data/{data → definitions}/el.yaml +0 -0
- data/{data → definitions}/es.yaml +37 -26
- data/{data → definitions}/federal_reserve.yaml +0 -0
- data/{data → definitions}/fedex.yaml +9 -3
- data/{data → definitions}/fi.yaml +0 -0
- data/{data → definitions}/fr.yaml +0 -0
- data/{data → definitions}/gb.yaml +19 -19
- data/{data → definitions}/hr.yaml +0 -0
- data/{data → definitions}/hu.yaml +1 -1
- data/{data → definitions}/ie.yaml +0 -0
- data/{data → definitions}/index.yaml +0 -0
- data/{data → definitions}/is.yaml +0 -0
- data/{data → definitions}/it.yaml +0 -0
- data/{data → definitions}/jp.yaml +3 -3
- data/{data → definitions}/li.yaml +3 -3
- data/{data → definitions}/lt.yaml +0 -0
- data/{data → definitions}/ma.yaml +0 -0
- data/{data → definitions}/mx.yaml +0 -0
- data/{data → definitions}/nerc.yaml +0 -0
- data/{data → definitions}/nl.yaml +0 -0
- data/{data → definitions}/no.yaml +0 -0
- data/{data → definitions}/north_america_informal.yaml +0 -0
- data/{data → definitions}/nyse.yaml +0 -0
- data/{data → definitions}/nz.yaml +21 -10
- data/{data → definitions}/ph.yaml +0 -0
- data/{data → definitions}/pl.yaml +0 -0
- data/{data → definitions}/pt.yaml +0 -0
- data/{data → definitions}/ro.yaml +1 -2
- data/{data → definitions}/se.yaml +0 -0
- data/{data → definitions}/sg.yaml +0 -0
- data/{data → definitions}/si.yaml +6 -6
- data/{data → definitions}/sk.yaml +0 -0
- data/{data → definitions}/united_nations.yaml +0 -0
- data/{data → definitions}/ups.yaml +17 -11
- data/{data → definitions}/us.yaml +20 -15
- data/{data → definitions}/ve.yaml +0 -0
- data/{data → definitions}/vi.yaml +0 -0
- data/{data → definitions}/za.yaml +0 -0
- data/holidays.gemspec +2 -1
- data/lib/generated_definitions/MANIFEST +56 -0
- data/lib/generated_definitions/REGIONS.rb +4 -0
- data/lib/{holidays → generated_definitions}/ar.rb +2 -2
- data/lib/{holidays → generated_definitions}/at.rb +2 -2
- data/lib/{holidays → generated_definitions}/au.rb +19 -10
- data/lib/{holidays → generated_definitions}/be.rb +2 -2
- data/lib/{holidays → generated_definitions}/br.rb +2 -2
- data/lib/{holidays → generated_definitions}/ca.rb +2 -2
- data/lib/{holidays → generated_definitions}/ch.rb +2 -2
- data/lib/{holidays → generated_definitions}/cl.rb +2 -2
- data/lib/{holidays → generated_definitions}/cr.rb +2 -2
- data/lib/{holidays → generated_definitions}/cz.rb +2 -2
- data/lib/{holidays → generated_definitions}/de.rb +5 -4
- data/lib/{holidays → generated_definitions}/dk.rb +2 -2
- data/lib/{holidays → generated_definitions}/ecb_target.rb +2 -2
- data/lib/{holidays → generated_definitions}/el.rb +2 -2
- data/lib/{holidays → generated_definitions}/es.rb +6 -6
- data/lib/{holidays → generated_definitions}/europe.rb +7 -6
- data/lib/{holidays → generated_definitions}/fed_ex.rb +8 -3
- data/lib/{holidays → generated_definitions}/federal_reserve.rb +2 -2
- data/lib/{holidays → generated_definitions}/fi.rb +2 -2
- data/lib/{holidays → generated_definitions}/fr.rb +2 -2
- data/lib/{holidays → generated_definitions}/gb.rb +2 -2
- data/lib/{holidays → generated_definitions}/hr.rb +2 -2
- data/lib/{holidays → generated_definitions}/hu.rb +2 -2
- data/lib/{holidays → generated_definitions}/ie.rb +2 -2
- data/lib/{holidays → generated_definitions}/is.rb +2 -2
- data/lib/{holidays → generated_definitions}/it.rb +2 -2
- data/lib/{holidays → generated_definitions}/jp.rb +5 -5
- data/lib/{holidays → generated_definitions}/li.rb +2 -2
- data/lib/{holidays → generated_definitions}/lt.rb +2 -2
- data/lib/{holidays → generated_definitions}/ma.rb +2 -2
- data/lib/{holidays → generated_definitions}/mx.rb +2 -2
- data/lib/{holidays → generated_definitions}/nerc.rb +2 -2
- data/lib/{holidays → generated_definitions}/nl.rb +2 -2
- data/lib/{holidays → generated_definitions}/no.rb +2 -2
- data/lib/{holidays → generated_definitions}/north_america.rb +8 -3
- data/lib/{holidays → generated_definitions}/nyse.rb +2 -2
- data/lib/{holidays → generated_definitions}/nz.rb +5 -5
- data/lib/{holidays → generated_definitions}/ph.rb +2 -2
- data/lib/{holidays → generated_definitions}/pl.rb +2 -2
- data/lib/{holidays → generated_definitions}/pt.rb +2 -2
- data/lib/{holidays → generated_definitions}/ro.rb +2 -2
- data/lib/{holidays → generated_definitions}/scandinavia.rb +2 -2
- data/lib/{holidays → generated_definitions}/se.rb +2 -2
- data/lib/{holidays → generated_definitions}/sg.rb +2 -2
- data/lib/{holidays → generated_definitions}/si.rb +2 -2
- data/lib/{holidays → generated_definitions}/sk.rb +2 -2
- data/lib/{holidays → generated_definitions}/united_nations.rb +2 -2
- data/lib/{holidays → generated_definitions}/ups.rb +8 -3
- data/lib/{holidays → generated_definitions}/us.rb +8 -3
- data/lib/{holidays → generated_definitions}/ve.rb +2 -2
- data/lib/{holidays → generated_definitions}/vi.rb +2 -2
- data/lib/{holidays → generated_definitions}/za.rb +2 -2
- data/lib/holidays.rb +120 -665
- data/lib/holidays/core_extensions/date.rb +39 -0
- data/lib/holidays/date_calculator/day_of_month.rb +68 -0
- data/lib/holidays/date_calculator/easter.rb +58 -0
- data/lib/holidays/date_calculator/weekend_modifier.rb +49 -0
- data/lib/holidays/date_calculator_factory.rb +21 -0
- data/lib/holidays/definition/context/generator.rb +216 -0
- data/lib/holidays/definition/context/merger.rb +26 -0
- data/lib/holidays/definition/repository/cache.rb +33 -0
- data/lib/holidays/definition/repository/holidays_by_month.rb +49 -0
- data/lib/holidays/definition/repository/proc_cache.rb +36 -0
- data/lib/holidays/definition/repository/regions.rb +36 -0
- data/lib/holidays/definition/validator/region.rb +45 -0
- data/lib/holidays/definition_factory.rb +50 -0
- data/lib/holidays/option/context/parse_options.rb +96 -0
- data/lib/holidays/option_factory.rb +14 -0
- data/lib/holidays/use_case/context/between.rb +105 -0
- data/lib/holidays/use_case/context/dates_driver_builder.rb +64 -0
- data/lib/holidays/use_case_factory.rb +20 -0
- data/lib/holidays/version.rb +1 -1
- data/test/defs/test_defs_ar.rb +1 -1
- data/test/defs/test_defs_at.rb +2 -2
- data/test/defs/test_defs_au.rb +61 -43
- data/test/defs/test_defs_be.rb +1 -1
- data/test/defs/test_defs_br.rb +1 -1
- data/test/defs/test_defs_ca.rb +1 -1
- data/test/defs/test_defs_ch.rb +1 -1
- data/test/defs/test_defs_cl.rb +1 -1
- data/test/defs/test_defs_cr.rb +1 -1
- data/test/defs/test_defs_cz.rb +1 -1
- data/test/defs/test_defs_de.rb +18 -30
- data/test/defs/test_defs_dk.rb +1 -1
- data/test/defs/test_defs_ecb_target.rb +3 -3
- data/test/defs/test_defs_el.rb +1 -1
- data/test/defs/test_defs_es.rb +36 -25
- data/test/defs/test_defs_europe.rb +82 -84
- data/test/defs/test_defs_fed_ex.rb +4 -1
- data/test/defs/test_defs_federal_reserve.rb +1 -1
- data/test/defs/test_defs_fi.rb +1 -1
- data/test/defs/test_defs_fr.rb +1 -1
- data/test/defs/test_defs_gb.rb +20 -20
- data/test/defs/test_defs_hr.rb +1 -1
- data/test/defs/test_defs_hu.rb +2 -2
- data/test/defs/test_defs_ie.rb +1 -1
- data/test/defs/test_defs_is.rb +1 -1
- data/test/defs/test_defs_it.rb +1 -1
- data/test/defs/test_defs_jp.rb +1 -1
- data/test/defs/test_defs_li.rb +4 -4
- data/test/defs/test_defs_lt.rb +1 -1
- data/test/defs/test_defs_ma.rb +1 -1
- data/test/defs/test_defs_mx.rb +1 -1
- data/test/defs/test_defs_nerc.rb +1 -1
- data/test/defs/test_defs_nl.rb +1 -1
- data/test/defs/test_defs_no.rb +1 -1
- data/test/defs/test_defs_north_america.rb +5 -3
- data/test/defs/test_defs_nyse.rb +1 -1
- data/test/defs/test_defs_nz.rb +19 -9
- data/test/defs/test_defs_ph.rb +1 -1
- data/test/defs/test_defs_pl.rb +1 -1
- data/test/defs/test_defs_pt.rb +1 -1
- data/test/defs/test_defs_ro.rb +2 -3
- data/test/defs/test_defs_scandinavia.rb +1 -1
- data/test/defs/test_defs_se.rb +1 -1
- data/test/defs/test_defs_sg.rb +1 -1
- data/test/defs/test_defs_si.rb +7 -7
- data/test/defs/test_defs_sk.rb +1 -1
- data/test/defs/test_defs_united_nations.rb +1 -1
- data/test/defs/test_defs_ups.rb +5 -2
- data/test/defs/test_defs_us.rb +5 -3
- data/test/defs/test_defs_ve.rb +1 -1
- data/test/defs/test_defs_vi.rb +1 -1
- data/test/defs/test_defs_za.rb +1 -1
- data/test/{test_date.rb → holidays/core_extensions/test_date.rb} +8 -2
- data/test/holidays/date_calculator/test_day_of_month.rb +27 -0
- data/test/holidays/date_calculator/test_easter.rb +29 -0
- data/test/holidays/date_calculator/test_weekend_modifier.rb +33 -0
- data/test/holidays/definition/context/test_generator.rb +84 -0
- data/test/holidays/definition/context/test_merger.rb +22 -0
- data/test/holidays/definition/repository/test_cache.rb +82 -0
- data/test/holidays/definition/repository/test_holidays_by_month.rb +187 -0
- data/test/holidays/definition/repository/test_proc_cache.rb +29 -0
- data/test/holidays/definition/repository/test_regions.rb +86 -0
- data/test/holidays/definition/validator/test_region.rb +50 -0
- data/test/holidays/option/context/test_parse_options.rb +69 -0
- data/test/holidays/test_date_calculator_factory.rb +21 -0
- data/test/holidays/test_definition_factory.rb +34 -0
- data/test/holidays/test_option_factory.rb +9 -0
- data/test/holidays/test_use_case_factory.rb +13 -0
- data/test/holidays/use_case/context/test_between.rb +75 -0
- data/test/holidays/use_case/context/test_dates_driver_builder.rb +91 -0
- data/test/test_all_regions.rb +14 -3
- data/test/test_helper.rb +2 -1
- data/test/test_holidays.rb +19 -24
- data/test/test_holidays_between.rb +85 -0
- data/test/test_multiple_regions.rb +2 -2
- data/test/test_parse_definitions.rb +10 -4
- metadata +181 -111
- data/.coveralls.yml +0 -1
- data/lib/holidays/MANIFEST +0 -55
data/test/defs/test_defs_el.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:
|
6
|
+
# Definitions loaded: definitions/el.yaml
|
7
7
|
class ElDefinitionTests < Test::Unit::TestCase # :nodoc:
|
8
8
|
|
9
9
|
def test_el
|
data/test/defs/test_defs_es.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:
|
6
|
+
# Definitions loaded: definitions/es.yaml
|
7
7
|
class EsDefinitionTests < Test::Unit::TestCase # :nodoc:
|
8
8
|
|
9
9
|
def test_es
|
@@ -20,43 +20,54 @@ class EsDefinitionTests < Test::Unit::TestCase # :nodoc:
|
|
20
20
|
assert_equal name, (Holidays.on(date, :es, :informal)[0] || {})[:name]
|
21
21
|
end
|
22
22
|
|
23
|
+
[:es_pv, :es_na, :es_an, :es_ib, :es_cm, :es_mu, :es_m, :es_ar, :es_cl, :es_cn, :es_lo, :es_ga, :es_ce, :es_o, :es_ex, :es_].each do |r|
|
24
|
+
assert_equal 'Jueves Santo', Holidays.on(Date.civil(2009,4,9), r)[0][:name]
|
25
|
+
end
|
23
26
|
[:es_pv, :es_ct, :es_na, :es_v, :es_vc, :es_].each do |r|
|
24
|
-
assert_equal '
|
25
|
-
assert_equal 'Lunes de Pascua', Date.civil(2009,4,13).holidays(r)[0][:name]
|
27
|
+
assert_equal 'Lunes de Pascua', Holidays.on(Date.civil(2009,4,13), r)[0][:name]
|
26
28
|
end
|
27
29
|
|
28
|
-
assert_equal 'Jueves Santo', Date.civil(2009,4,9)
|
30
|
+
assert_equal 'Jueves Santo', Holidays.on(Date.civil(2009,4,9), :es_an)[0][:name]
|
29
31
|
|
30
32
|
[:es_v, :es_vc, :es_cm, :es_mu, :es_m, :es_].each do |r|
|
31
|
-
assert_equal 'San José', Date.civil(2009,3,19)
|
33
|
+
assert_equal 'San José', Holidays.on(Date.civil(2009,3,19), r)[0][:name]
|
34
|
+
end
|
35
|
+
|
36
|
+
[:es_cl].each do |r|
|
37
|
+
assert_equal 'Día de Castilla y León', Holidays.on(Date.civil(2009,4,23), r)[0][:name]
|
32
38
|
end
|
33
39
|
|
34
|
-
[:es_ar
|
35
|
-
assert_equal 'San Jorge', Date.civil(2009,4,23)
|
40
|
+
[:es_ar].each do |r|
|
41
|
+
assert_equal 'San Jorge, Día de Aragón', Holidays.on(Date.civil(2009,4,23), r)[0][:name]
|
42
|
+
end
|
43
|
+
|
44
|
+
[:es_].each do |r|
|
45
|
+
assert_equal 'Día de Castilla y León', Holidays.on(Date.civil(2009,4,23), r)[0][:name]
|
46
|
+
assert_equal 'San Jorge, Día de Aragón', Holidays.on(Date.civil(2009,4,23), r)[1][:name]
|
36
47
|
end
|
37
48
|
|
38
49
|
[:es_vc, :es_v, :es_].each do |r|
|
39
|
-
assert_equal 'Día de Valencia', Date.civil(2009,10,9)
|
50
|
+
assert_equal 'Día de Valencia', Holidays.on(Date.civil(2009,10,9), r)[0][:name]
|
40
51
|
end
|
41
52
|
|
42
53
|
[:es_ib, :es_ct, :es_].each do |r|
|
43
|
-
assert_equal 'San Esteban', Date.civil(2009,12,26)
|
44
|
-
end
|
45
|
-
|
46
|
-
assert_equal 'Año Nuevo', Date.civil(2012,1,1)
|
47
|
-
assert_equal 'Año Nuevo', Date.civil(2012,1,2)
|
48
|
-
assert_equal 'Día de Andalucía', Date.civil(2009,2,28)
|
49
|
-
assert_equal 'Día de las Islas Baleares', Date.civil(2009,3,1)
|
50
|
-
assert_equal 'Fiesta de la Comunidad', Date.civil(2006,5,2)
|
51
|
-
assert_equal 'Día de las Canarias', Date.civil(2006,5,30)
|
52
|
-
assert_equal 'Día de la Región Castilla-La Mancha', Date.civil(2009,5,31)
|
53
|
-
assert_equal 'Día de la Región de Murcia', Date.civil(2009,6,9)
|
54
|
-
assert_equal 'Día de La Rioja', Date.civil(2009,6,9)
|
55
|
-
assert_equal 'Santiago Apostol', Date.civil(2009,7,23)
|
56
|
-
assert_equal 'Día de Ceuta', Date.civil(2009,9,2)
|
57
|
-
assert_equal 'Día de Asturias', Date.civil(2009,9,8)
|
58
|
-
assert_equal 'Día de Extremadura', Date.civil(2009,9,8)
|
59
|
-
assert_equal 'Fiesta Nacional de Cataluña', Date.civil(2009,9,11)
|
54
|
+
assert_equal 'San Esteban', Holidays.on(Date.civil(2009,12,26), r)[0][:name]
|
55
|
+
end
|
56
|
+
|
57
|
+
assert_equal 'Año Nuevo', Holidays.on(Date.civil(2012,1,1), :es)[0][:name]
|
58
|
+
assert_equal 'Año Nuevo', Holidays.on(Date.civil(2012,1,2), :es, :observed)[0][:name]
|
59
|
+
assert_equal 'Día de Andalucía', Holidays.on(Date.civil(2009,2,28), :es_an)[0][:name]
|
60
|
+
assert_equal 'Día de las Islas Baleares', Holidays.on(Date.civil(2009,3,1), :es_ib)[0][:name]
|
61
|
+
assert_equal 'Fiesta de la Comunidad', Holidays.on(Date.civil(2006,5,2), :es_m)[0][:name]
|
62
|
+
assert_equal 'Día de las Canarias', Holidays.on(Date.civil(2006,5,30), :es_cn)[0][:name]
|
63
|
+
assert_equal 'Día de la Región Castilla-La Mancha', Holidays.on(Date.civil(2009,5,31), :es_cm)[0][:name]
|
64
|
+
assert_equal 'Día de la Región de Murcia', Holidays.on(Date.civil(2009,6,9), :es_mu)[0][:name]
|
65
|
+
assert_equal 'Día de La Rioja', Holidays.on(Date.civil(2009,6,9), :es_lo)[0][:name]
|
66
|
+
assert_equal 'Santiago Apostol', Holidays.on(Date.civil(2009,7,23), :es_ga)[0][:name]
|
67
|
+
assert_equal 'Día de Ceuta', Holidays.on(Date.civil(2009,9,2), :es_ce)[0][:name]
|
68
|
+
assert_equal 'Día de Asturias', Holidays.on(Date.civil(2009,9,8), :es_o)[0][:name]
|
69
|
+
assert_equal 'Día de Extremadura', Holidays.on(Date.civil(2009,9,8), :es_ex)[0][:name]
|
70
|
+
assert_equal 'Fiesta Nacional de Cataluña', Holidays.on(Date.civil(2009,9,11), :es_ct)[0][:name]
|
60
71
|
|
61
72
|
end
|
62
73
|
end
|
@@ -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:
|
6
|
+
# Definitions loaded: definitions/at.yaml, definitions/be.yaml, definitions/ch.yaml, definitions/cz.yaml, definitions/dk.yaml, definitions/de.yaml, definitions/el.yaml, definitions/es.yaml, definitions/fr.yaml, definitions/gb.yaml, definitions/hr.yaml, definitions/hu.yaml, definitions/ie.yaml, definitions/is.yaml, definitions/it.yaml, definitions/li.yaml, definitions/lt.yaml, definitions/nl.yaml, definitions/no.yaml, definitions/pl.yaml, definitions/pt.yaml, definitions/ro.yaml, definitions/sk.yaml, definitions/si.yaml
|
7
7
|
class EuropeDefinitionTests < Test::Unit::TestCase # :nodoc:
|
8
8
|
|
9
9
|
def test_europe
|
@@ -18,7 +18,7 @@ class EuropeDefinitionTests < Test::Unit::TestCase # :nodoc:
|
|
18
18
|
assert_equal name, (Holidays.on(date, :at, :informal)[0] || {})[:name]
|
19
19
|
end
|
20
20
|
|
21
|
-
|
21
|
+
assert_equal [], Holidays.on(Date.civil(2010,5,8), :at), '2010-05-08 is not a holiday in Austria'
|
22
22
|
|
23
23
|
|
24
24
|
{Date.civil(2007,1,1) => 'Jour de l\'an',
|
@@ -115,56 +115,44 @@ end
|
|
115
115
|
end
|
116
116
|
|
117
117
|
[:de_bw, :de_by, :de_st, :de_].each do |r|
|
118
|
-
assert_equal 'Heilige Drei Könige', Date.civil(2009,1,6)
|
118
|
+
assert_equal 'Heilige Drei Könige', Holidays.on(Date.civil(2009,1,6), r)[0][:name]
|
119
119
|
end
|
120
120
|
|
121
121
|
[:de_bw, :de_by, :de_he, :de_nw, :de_rp, :de_sl, :de_].each do |r|
|
122
|
-
assert_equal 'Fronleichnam', Date.civil(2009,6,11)
|
122
|
+
assert_equal 'Fronleichnam', Holidays.on(Date.civil(2009,6,11), r)[0][:name]
|
123
123
|
end
|
124
124
|
|
125
125
|
[:de_by, :de_sl, :de_].each do |r|
|
126
|
-
assert_equal 'Mariä Himmelfahrt', Date.civil(2009,8,15)
|
126
|
+
assert_equal 'Mariä Himmelfahrt', Holidays.on(Date.civil(2009,8,15), r)[0][:name]
|
127
127
|
end
|
128
128
|
|
129
129
|
[:de_bb, :de_mv, :de_sn, :de_st, :de_th, :de_].each do |r|
|
130
|
-
assert_equal 'Reformationstag', Date.civil(2009,10,31)
|
130
|
+
assert_equal 'Reformationstag', Holidays.on(Date.civil(2009,10,31), r)[0][:name]
|
131
131
|
end
|
132
132
|
|
133
133
|
[:de_bw, :de_by, :de_nw, :de_rp, :de_sl, :de_].each do |r|
|
134
|
-
assert_equal 'Allerheiligen', Date.civil(2009,11,1)
|
134
|
+
assert_equal 'Allerheiligen', Holidays.on(Date.civil(2009,11,1), r)[0][:name]
|
135
135
|
end
|
136
136
|
|
137
|
-
[:
|
138
|
-
assert_equal '
|
137
|
+
[:de_by_aux].each do |r|
|
138
|
+
assert_equal 'Friedensfest', Date.civil(2015,8,8).holidays(r)[0][:name]
|
139
139
|
end
|
140
140
|
|
141
|
-
[:
|
142
|
-
|
141
|
+
[:de,
|
142
|
+
:de_bw, :de_by, :de_bb, :de_he, :de_mv,
|
143
|
+
:de_nw, :de_rp, :de_sl, :de_sn, :de_st, :de_th].each do |r|
|
144
|
+
assert_equal [], Holidays.on(Date.civil(2015,8,8), r), "Friedensfest is not a holiday in #{r}"
|
143
145
|
end
|
144
146
|
|
145
|
-
[
|
146
|
-
assert !Date.civil(2009,6,11).holiday?(r), "Fronleichnam is not a holiday in #{r}"
|
147
|
-
end
|
148
|
-
|
149
|
-
[:de_be, :de_hb, :de_hh, :de_ni, :de_sh].each do |r|
|
150
|
-
assert !Date.civil(2009,8,15).holiday?(r), "Mariä Himmelfahrt is not a holiday in #{r}"
|
151
|
-
end
|
152
|
-
|
153
|
-
[:de_be, :de_hb, :de_hh, :de_ni, :de_sh].each do |r|
|
154
|
-
assert !Date.civil(2009,10,31).holiday?(r), 'Reformationstag is not a holiday in #{r}'
|
155
|
-
end
|
156
|
-
|
157
|
-
[:de_be, :de_hb, :de_hh, :de_ni, :de_sh].each do |r|
|
158
|
-
assert !Date.civil(2009,11,1).holiday?(r), "Allerheiligen is not a holiday in #{r}"
|
159
|
-
end
|
147
|
+
assert_equal [], Holidays.on(Date.civil(2010,5,8), :de), '2010-05-08 is not a holiday in Germany'
|
160
148
|
|
161
|
-
|
149
|
+
assert_equal [], Holidays.on(Date.civil(2010,8,8), :de), '2010-08-08 is not a holiday in Germany'
|
162
150
|
|
163
151
|
# Repentance Day
|
164
|
-
assert_equal 'Buß- und Bettag', Date.civil(2004,11,17)
|
165
|
-
assert_equal 'Buß- und Bettag', Date.civil(2005,11,16)
|
166
|
-
assert_equal 'Buß- und Bettag', Date.civil(2006,11,22)
|
167
|
-
assert_equal 'Buß- und Bettag', Date.civil(2009,11,18)
|
152
|
+
assert_equal 'Buß- und Bettag', Holidays.on(Date.civil(2004,11,17), :de_sn)[0][:name]
|
153
|
+
assert_equal 'Buß- und Bettag', Holidays.on(Date.civil(2005,11,16), :de_sn)[0][:name]
|
154
|
+
assert_equal 'Buß- und Bettag', Holidays.on(Date.civil(2006,11,22), :de_sn)[0][:name]
|
155
|
+
assert_equal 'Buß- und Bettag', Holidays.on(Date.civil(2009,11,18), :de_sn)[0][:name]
|
168
156
|
|
169
157
|
|
170
158
|
{Date.civil(2011,1,1) => 'Πρωτοχρονιά',
|
@@ -198,43 +186,54 @@ end
|
|
198
186
|
assert_equal name, (Holidays.on(date, :es, :informal)[0] || {})[:name]
|
199
187
|
end
|
200
188
|
|
189
|
+
[:es_pv, :es_na, :es_an, :es_ib, :es_cm, :es_mu, :es_m, :es_ar, :es_cl, :es_cn, :es_lo, :es_ga, :es_ce, :es_o, :es_ex, :es_].each do |r|
|
190
|
+
assert_equal 'Jueves Santo', Holidays.on(Date.civil(2009,4,9), r)[0][:name]
|
191
|
+
end
|
201
192
|
[:es_pv, :es_ct, :es_na, :es_v, :es_vc, :es_].each do |r|
|
202
|
-
assert_equal '
|
203
|
-
assert_equal 'Lunes de Pascua', Date.civil(2009,4,13).holidays(r)[0][:name]
|
193
|
+
assert_equal 'Lunes de Pascua', Holidays.on(Date.civil(2009,4,13), r)[0][:name]
|
204
194
|
end
|
205
195
|
|
206
|
-
assert_equal 'Jueves Santo', Date.civil(2009,4,9)
|
196
|
+
assert_equal 'Jueves Santo', Holidays.on(Date.civil(2009,4,9), :es_an)[0][:name]
|
207
197
|
|
208
198
|
[:es_v, :es_vc, :es_cm, :es_mu, :es_m, :es_].each do |r|
|
209
|
-
assert_equal 'San José', Date.civil(2009,3,19)
|
199
|
+
assert_equal 'San José', Holidays.on(Date.civil(2009,3,19), r)[0][:name]
|
200
|
+
end
|
201
|
+
|
202
|
+
[:es_cl].each do |r|
|
203
|
+
assert_equal 'Día de Castilla y León', Holidays.on(Date.civil(2009,4,23), r)[0][:name]
|
204
|
+
end
|
205
|
+
|
206
|
+
[:es_ar].each do |r|
|
207
|
+
assert_equal 'San Jorge, Día de Aragón', Holidays.on(Date.civil(2009,4,23), r)[0][:name]
|
210
208
|
end
|
211
209
|
|
212
|
-
[:
|
213
|
-
assert_equal '
|
210
|
+
[:es_].each do |r|
|
211
|
+
assert_equal 'Día de Castilla y León', Holidays.on(Date.civil(2009,4,23), r)[0][:name]
|
212
|
+
assert_equal 'San Jorge, Día de Aragón', Holidays.on(Date.civil(2009,4,23), r)[1][:name]
|
214
213
|
end
|
215
214
|
|
216
215
|
[:es_vc, :es_v, :es_].each do |r|
|
217
|
-
assert_equal 'Día de Valencia', Date.civil(2009,10,9)
|
216
|
+
assert_equal 'Día de Valencia', Holidays.on(Date.civil(2009,10,9), r)[0][:name]
|
218
217
|
end
|
219
218
|
|
220
219
|
[:es_ib, :es_ct, :es_].each do |r|
|
221
|
-
assert_equal 'San Esteban', Date.civil(2009,12,26)
|
220
|
+
assert_equal 'San Esteban', Holidays.on(Date.civil(2009,12,26), r)[0][:name]
|
222
221
|
end
|
223
222
|
|
224
|
-
assert_equal 'Año Nuevo', Date.civil(2012,1,1)
|
225
|
-
assert_equal 'Año Nuevo', Date.civil(2012,1,2)
|
226
|
-
assert_equal 'Día de Andalucía', Date.civil(2009,2,28)
|
227
|
-
assert_equal 'Día de las Islas Baleares', Date.civil(2009,3,1)
|
228
|
-
assert_equal 'Fiesta de la Comunidad', Date.civil(2006,5,2)
|
229
|
-
assert_equal 'Día de las Canarias', Date.civil(2006,5,30)
|
230
|
-
assert_equal 'Día de la Región Castilla-La Mancha', Date.civil(2009,5,31)
|
231
|
-
assert_equal 'Día de la Región de Murcia', Date.civil(2009,6,9)
|
232
|
-
assert_equal 'Día de La Rioja', Date.civil(2009,6,9)
|
233
|
-
assert_equal 'Santiago Apostol', Date.civil(2009,7,23)
|
234
|
-
assert_equal 'Día de Ceuta', Date.civil(2009,9,2)
|
235
|
-
assert_equal 'Día de Asturias', Date.civil(2009,9,8)
|
236
|
-
assert_equal 'Día de Extremadura', Date.civil(2009,9,8)
|
237
|
-
assert_equal 'Fiesta Nacional de Cataluña', Date.civil(2009,9,11)
|
223
|
+
assert_equal 'Año Nuevo', Holidays.on(Date.civil(2012,1,1), :es)[0][:name]
|
224
|
+
assert_equal 'Año Nuevo', Holidays.on(Date.civil(2012,1,2), :es, :observed)[0][:name]
|
225
|
+
assert_equal 'Día de Andalucía', Holidays.on(Date.civil(2009,2,28), :es_an)[0][:name]
|
226
|
+
assert_equal 'Día de las Islas Baleares', Holidays.on(Date.civil(2009,3,1), :es_ib)[0][:name]
|
227
|
+
assert_equal 'Fiesta de la Comunidad', Holidays.on(Date.civil(2006,5,2), :es_m)[0][:name]
|
228
|
+
assert_equal 'Día de las Canarias', Holidays.on(Date.civil(2006,5,30), :es_cn)[0][:name]
|
229
|
+
assert_equal 'Día de la Región Castilla-La Mancha', Holidays.on(Date.civil(2009,5,31), :es_cm)[0][:name]
|
230
|
+
assert_equal 'Día de la Región de Murcia', Holidays.on(Date.civil(2009,6,9), :es_mu)[0][:name]
|
231
|
+
assert_equal 'Día de La Rioja', Holidays.on(Date.civil(2009,6,9), :es_lo)[0][:name]
|
232
|
+
assert_equal 'Santiago Apostol', Holidays.on(Date.civil(2009,7,23), :es_ga)[0][:name]
|
233
|
+
assert_equal 'Día de Ceuta', Holidays.on(Date.civil(2009,9,2), :es_ce)[0][:name]
|
234
|
+
assert_equal 'Día de Asturias', Holidays.on(Date.civil(2009,9,8), :es_o)[0][:name]
|
235
|
+
assert_equal 'Día de Extremadura', Holidays.on(Date.civil(2009,9,8), :es_ex)[0][:name]
|
236
|
+
assert_equal 'Fiesta Nacional de Cataluña', Holidays.on(Date.civil(2009,9,11), :es_ct)[0][:name]
|
238
237
|
|
239
238
|
|
240
239
|
{Date.civil(2007,1,1) => 'Jour de l\'an',
|
@@ -267,31 +266,31 @@ end
|
|
267
266
|
assert_equal name, (Holidays.on(date, :gb, :informal)[0] || {})[:name]
|
268
267
|
end
|
269
268
|
|
270
|
-
assert_equal 'St. Patrick\'s Day', Date.civil(2008,3,17)
|
271
|
-
assert_equal 'St. Andrew\'s Day', Date.civil(2008,11,30)
|
269
|
+
assert_equal 'St. Patrick\'s Day', Holidays.on(Date.civil(2008,3,17), :gb_nir, :informal)[0][:name]
|
270
|
+
assert_equal 'St. Andrew\'s Day', Holidays.on(Date.civil(2008,11,30), :gb_sct, :informal)[0][:name]
|
272
271
|
|
273
|
-
assert_equal 'Christmas Day', Date.civil(2008,12,25)
|
274
|
-
assert_equal 'Christmas Day', Date.civil(2009,12,25)
|
275
|
-
assert_equal 'Christmas Day', Date.civil(2010,12,27)
|
272
|
+
assert_equal 'Christmas Day', Holidays.on(Date.civil(2008,12,25), :gb_, :observed)[0][:name]
|
273
|
+
assert_equal 'Christmas Day', Holidays.on(Date.civil(2009,12,25), :gb_, :observed)[0][:name]
|
274
|
+
assert_equal 'Christmas Day', Holidays.on(Date.civil(2010,12,27), :gb_, :observed)[0][:name]
|
276
275
|
|
277
|
-
assert_equal 'Boxing Day', Date.civil(2008,12,26)
|
278
|
-
assert_equal 'Boxing Day', Date.civil(2009,12,28)
|
279
|
-
assert_equal 'Boxing Day', Date.civil(2010,12,28)
|
280
|
-
assert_equal 'Boxing Day', Date.civil(2011,12,27)
|
276
|
+
assert_equal 'Boxing Day', Holidays.on(Date.civil(2008,12,26), :gb_, :observed)[0][:name]
|
277
|
+
assert_equal 'Boxing Day', Holidays.on(Date.civil(2009,12,28), :gb_, :observed)[0][:name]
|
278
|
+
assert_equal 'Boxing Day', Holidays.on(Date.civil(2010,12,28), :gb_, :observed)[0][:name]
|
279
|
+
assert_equal 'Boxing Day', Holidays.on(Date.civil(2011,12,27), :gb_, :observed)[0][:name]
|
281
280
|
|
282
|
-
assert_equal 'New Year\'s Day', Date.civil(2010,1,1)
|
283
|
-
assert_equal 'New Year\'s Day', Date.civil(2011,1,3)
|
284
|
-
assert_equal 'New Year\'s Day', Date.civil(2012,1,2)
|
281
|
+
assert_equal 'New Year\'s Day', Holidays.on(Date.civil(2010,1,1), :gb, :observed)[0][:name]
|
282
|
+
assert_equal 'New Year\'s Day', Holidays.on(Date.civil(2011,1,3), :gb, :observed)[0][:name]
|
283
|
+
assert_equal 'New Year\'s Day', Holidays.on(Date.civil(2012,1,2), :gb, :observed)[0][:name]
|
285
284
|
|
286
|
-
assert_equal '2nd January', Date.civil(2010,1,4)
|
287
|
-
assert_equal '2nd January', Date.civil(2011,1,4)
|
288
|
-
assert_equal '2nd January', Date.civil(2012,1,3)
|
289
|
-
assert_equal '2nd January', Date.civil(2013,1,2)
|
290
|
-
assert_equal '2nd January', Date.civil(2014,1,2)
|
285
|
+
assert_equal '2nd January', Holidays.on(Date.civil(2010,1,4), :gb_sct, :observed)[0][:name]
|
286
|
+
assert_equal '2nd January', Holidays.on(Date.civil(2011,1,4), :gb_sct, :observed)[0][:name]
|
287
|
+
assert_equal '2nd January', Holidays.on(Date.civil(2012,1,3), :gb_sct, :observed)[0][:name]
|
288
|
+
assert_equal '2nd January', Holidays.on(Date.civil(2013,1,2), :gb_sct, :observed)[0][:name]
|
289
|
+
assert_equal '2nd January', Holidays.on(Date.civil(2014,1,2), :gb_sct, :observed)[0][:name]
|
291
290
|
|
292
291
|
[:gb_wls, :gb_eng, :gb_nir, :gb_eaw, :gb_].each do |r|
|
293
|
-
assert_equal 'Easter Monday', Date.civil(2008,3,24)
|
294
|
-
assert_equal 'Bank Holiday', Date.civil(2008,8,25)
|
292
|
+
assert_equal 'Easter Monday', Holidays.on(Date.civil(2008,3,24), r)[0][:name]
|
293
|
+
assert_equal 'Bank Holiday', Holidays.on(Date.civil(2008,8,25), r)[0][:name]
|
295
294
|
end
|
296
295
|
|
297
296
|
|
@@ -332,7 +331,7 @@ end
|
|
332
331
|
assert_equal name, (Holidays.on(date, :hu, :informal)[0] || {})[:name]
|
333
332
|
end
|
334
333
|
|
335
|
-
|
334
|
+
assert_equal [], Holidays.on(Date.civil(2012,3,14), :hu), '2012-03-14 is not a holiday in Hungary'
|
336
335
|
|
337
336
|
|
338
337
|
{Date.civil(2008,1,1) => 'New Year\'s Day',
|
@@ -412,15 +411,15 @@ end
|
|
412
411
|
end
|
413
412
|
|
414
413
|
[:li].each do |r|
|
415
|
-
assert_equal 'Fronleichnam', Date.civil(2009,6,11)
|
414
|
+
assert_equal 'Fronleichnam', Holidays.on(Date.civil(2009,6,11), r)[0][:name]
|
416
415
|
end
|
417
416
|
|
418
417
|
[:li].each do |r|
|
419
|
-
assert_equal 'Staatsfeiertag', Date.civil(2009,8,15)
|
418
|
+
assert_equal 'Staatsfeiertag', Holidays.on(Date.civil(2009,8,15), r)[0][:name]
|
420
419
|
end
|
421
420
|
|
422
421
|
[:li].each do |r|
|
423
|
-
assert_equal 'Allerheiligen', Date.civil(2009,11,1)
|
422
|
+
assert_equal 'Allerheiligen', Holidays.on(Date.civil(2009,11,1), r)[0][:name]
|
424
423
|
end
|
425
424
|
|
426
425
|
|
@@ -664,8 +663,7 @@ end
|
|
664
663
|
assert_equal name, (Holidays.on(date, :ro, :informal)[0] || {})[:name]
|
665
664
|
end
|
666
665
|
|
667
|
-
|
668
|
-
assert !Date.civil(2013,7,23).holiday?(:ro), '2010-07-23 is not a holiday in Romania'
|
666
|
+
assert_equal [], Holidays.on(Date.civil(2013,7,23), :ro), '2013-07-23 is not a holiday in Romania'
|
669
667
|
|
670
668
|
|
671
669
|
{Date.civil(2013,1,1) => 'Nový rok',
|
@@ -687,14 +685,14 @@ end
|
|
687
685
|
end
|
688
686
|
|
689
687
|
|
690
|
-
assert_equal 'velikonočna nedelja', Date.civil(2015,4,5)
|
691
|
-
assert_equal 'velikonočna nedelja', Date.civil(2016,3,27)
|
688
|
+
assert_equal 'velikonočna nedelja', Holidays.on(Date.civil(2015,4,5), :si)[0][:name]
|
689
|
+
assert_equal 'velikonočna nedelja', Holidays.on(Date.civil(2016,3,27), :si)[0][:name]
|
692
690
|
|
693
|
-
assert_equal 'velikonočni ponedeljek', Date.civil(2015,4,6)
|
694
|
-
assert_equal 'velikonočni ponedeljek', Date.civil(2016,3,28)
|
691
|
+
assert_equal 'velikonočni ponedeljek', Holidays.on(Date.civil(2015,4,6), :si)[0][:name]
|
692
|
+
assert_equal 'velikonočni ponedeljek', Holidays.on(Date.civil(2016,3,28), :si)[0][:name]
|
695
693
|
|
696
|
-
assert_equal 'binkošti', Date.civil(2015,5,24)
|
697
|
-
assert_equal 'binkošti', Date.civil(2016,5,15)
|
694
|
+
assert_equal 'binkošti', Holidays.on(Date.civil(2015,5,24), :si)[0][:name]
|
695
|
+
assert_equal 'binkošti', Holidays.on(Date.civil(2016,5,15), :si)[0][:name]
|
698
696
|
|
699
697
|
(2014..2020).each do |year|
|
700
698
|
{Date.civil(year,1,1) => 'novo leto',
|
@@ -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:
|
6
|
+
# Definitions loaded: definitions/fedex.yaml
|
7
7
|
class Fed_exDefinitionTests < Test::Unit::TestCase # :nodoc:
|
8
8
|
|
9
9
|
def test_fed_ex
|
@@ -13,9 +13,12 @@ class Fed_exDefinitionTests < Test::Unit::TestCase # :nodoc:
|
|
13
13
|
Date.civil(2015,9,7) => 'Labor Day',
|
14
14
|
Date.civil(2015,11,26) => 'Thanksgiving',
|
15
15
|
Date.civil(2015,11,27) => 'Day After Thanksgiving',
|
16
|
+
Date.civil(2013,11,28) => 'Thanksgiving',
|
17
|
+
Date.civil(2013,11,29) => 'Day After Thanksgiving',
|
16
18
|
Date.civil(2015,12,25) => 'Christmas Day',
|
17
19
|
Date.civil(2015,12,31) => 'New Year\'s Eve',}.each do |date, name|
|
18
20
|
assert_equal name, (Holidays.on(date, :ups)[0] || {})[:name]
|
19
21
|
end
|
22
|
+
|
20
23
|
end
|
21
24
|
end
|
@@ -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:
|
6
|
+
# Definitions loaded: definitions/federal_reserve.yaml
|
7
7
|
class Federal_reserveDefinitionTests < Test::Unit::TestCase # :nodoc:
|
8
8
|
|
9
9
|
def test_federal_reserve
|
data/test/defs/test_defs_fi.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:
|
6
|
+
# Definitions loaded: definitions/fi.yaml
|
7
7
|
class FiDefinitionTests < Test::Unit::TestCase # :nodoc:
|
8
8
|
|
9
9
|
def test_fi
|
data/test/defs/test_defs_fr.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:
|
6
|
+
# Definitions loaded: definitions/fr.yaml
|
7
7
|
class FrDefinitionTests < Test::Unit::TestCase # :nodoc:
|
8
8
|
|
9
9
|
def test_fr
|
data/test/defs/test_defs_gb.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:
|
6
|
+
# Definitions loaded: definitions/gb.yaml
|
7
7
|
class GbDefinitionTests < Test::Unit::TestCase # :nodoc:
|
8
8
|
|
9
9
|
def test_gb
|
@@ -17,31 +17,31 @@ class GbDefinitionTests < Test::Unit::TestCase # :nodoc:
|
|
17
17
|
assert_equal name, (Holidays.on(date, :gb, :informal)[0] || {})[:name]
|
18
18
|
end
|
19
19
|
|
20
|
-
assert_equal 'St. Patrick\'s Day', Date.civil(2008,3,17)
|
21
|
-
assert_equal 'St. Andrew\'s Day', Date.civil(2008,11,30)
|
20
|
+
assert_equal 'St. Patrick\'s Day', Holidays.on(Date.civil(2008,3,17), :gb_nir, :informal)[0][:name]
|
21
|
+
assert_equal 'St. Andrew\'s Day', Holidays.on(Date.civil(2008,11,30), :gb_sct, :informal)[0][:name]
|
22
22
|
|
23
|
-
assert_equal 'Christmas Day', Date.civil(2008,12,25)
|
24
|
-
assert_equal 'Christmas Day', Date.civil(2009,12,25)
|
25
|
-
assert_equal 'Christmas Day', Date.civil(2010,12,27)
|
23
|
+
assert_equal 'Christmas Day', Holidays.on(Date.civil(2008,12,25), :gb_, :observed)[0][:name]
|
24
|
+
assert_equal 'Christmas Day', Holidays.on(Date.civil(2009,12,25), :gb_, :observed)[0][:name]
|
25
|
+
assert_equal 'Christmas Day', Holidays.on(Date.civil(2010,12,27), :gb_, :observed)[0][:name]
|
26
26
|
|
27
|
-
assert_equal 'Boxing Day', Date.civil(2008,12,26)
|
28
|
-
assert_equal 'Boxing Day', Date.civil(2009,12,28)
|
29
|
-
assert_equal 'Boxing Day', Date.civil(2010,12,28)
|
30
|
-
assert_equal 'Boxing Day', Date.civil(2011,12,27)
|
27
|
+
assert_equal 'Boxing Day', Holidays.on(Date.civil(2008,12,26), :gb_, :observed)[0][:name]
|
28
|
+
assert_equal 'Boxing Day', Holidays.on(Date.civil(2009,12,28), :gb_, :observed)[0][:name]
|
29
|
+
assert_equal 'Boxing Day', Holidays.on(Date.civil(2010,12,28), :gb_, :observed)[0][:name]
|
30
|
+
assert_equal 'Boxing Day', Holidays.on(Date.civil(2011,12,27), :gb_, :observed)[0][:name]
|
31
31
|
|
32
|
-
assert_equal 'New Year\'s Day', Date.civil(2010,1,1)
|
33
|
-
assert_equal 'New Year\'s Day', Date.civil(2011,1,3)
|
34
|
-
assert_equal 'New Year\'s Day', Date.civil(2012,1,2)
|
32
|
+
assert_equal 'New Year\'s Day', Holidays.on(Date.civil(2010,1,1), :gb, :observed)[0][:name]
|
33
|
+
assert_equal 'New Year\'s Day', Holidays.on(Date.civil(2011,1,3), :gb, :observed)[0][:name]
|
34
|
+
assert_equal 'New Year\'s Day', Holidays.on(Date.civil(2012,1,2), :gb, :observed)[0][:name]
|
35
35
|
|
36
|
-
assert_equal '2nd January', Date.civil(2010,1,4)
|
37
|
-
assert_equal '2nd January', Date.civil(2011,1,4)
|
38
|
-
assert_equal '2nd January', Date.civil(2012,1,3)
|
39
|
-
assert_equal '2nd January', Date.civil(2013,1,2)
|
40
|
-
assert_equal '2nd January', Date.civil(2014,1,2)
|
36
|
+
assert_equal '2nd January', Holidays.on(Date.civil(2010,1,4), :gb_sct, :observed)[0][:name]
|
37
|
+
assert_equal '2nd January', Holidays.on(Date.civil(2011,1,4), :gb_sct, :observed)[0][:name]
|
38
|
+
assert_equal '2nd January', Holidays.on(Date.civil(2012,1,3), :gb_sct, :observed)[0][:name]
|
39
|
+
assert_equal '2nd January', Holidays.on(Date.civil(2013,1,2), :gb_sct, :observed)[0][:name]
|
40
|
+
assert_equal '2nd January', Holidays.on(Date.civil(2014,1,2), :gb_sct, :observed)[0][:name]
|
41
41
|
|
42
42
|
[:gb_wls, :gb_eng, :gb_nir, :gb_eaw, :gb_].each do |r|
|
43
|
-
assert_equal 'Easter Monday', Date.civil(2008,3,24)
|
44
|
-
assert_equal 'Bank Holiday', Date.civil(2008,8,25)
|
43
|
+
assert_equal 'Easter Monday', Holidays.on(Date.civil(2008,3,24), r)[0][:name]
|
44
|
+
assert_equal 'Bank Holiday', Holidays.on(Date.civil(2008,8,25), r)[0][:name]
|
45
45
|
end
|
46
46
|
|
47
47
|
end
|