holidays 5.7.0 → 6.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitmodules +1 -1
- data/CHANGELOG.md +11 -0
- data/lib/generated_definitions/north_america.rb +1 -1
- data/lib/generated_definitions/tr.rb +1 -0
- data/lib/generated_definitions/us.rb +1 -1
- data/lib/holidays/definition/context/generator.rb +5 -36
- data/lib/holidays/definition/decorator/test.rb +37 -0
- data/lib/holidays/definition/entity/test.rb +11 -0
- data/lib/holidays/definition/generator/test.rb +51 -0
- data/lib/holidays/definition/parser/test.rb +86 -0
- data/lib/holidays/definition/validator/test.rb +71 -0
- data/lib/holidays/errors.rb +3 -0
- data/lib/holidays/factory/definition.rb +24 -0
- data/lib/holidays/version.rb +1 -1
- data/test/coverage_report.rb +1 -0
- data/test/data/test_custom_year_range_holiday_defs.yaml +7 -0
- data/test/data/test_multiple_custom_holiday_defs.yaml +7 -4
- data/test/data/test_single_custom_holiday_defs.yaml +7 -4
- data/test/data/test_single_custom_holiday_with_custom_procs.yaml +11 -7
- data/test/defs/test_defs_ar.rb +33 -19
- data/test/defs/test_defs_at.rb +14 -11
- data/test/defs/test_defs_au.rb +172 -141
- data/test/defs/test_defs_be_fr.rb +23 -14
- data/test/defs/test_defs_be_nl.rb +23 -14
- data/test/defs/test_defs_bg.rb +29 -17
- data/test/defs/test_defs_br.rb +33 -19
- data/test/defs/test_defs_ca.rb +175 -176
- data/test/defs/test_defs_ch.rb +29 -23
- data/test/defs/test_defs_cl.rb +49 -27
- data/test/defs/test_defs_cr.rb +17 -11
- data/test/defs/test_defs_cz.rb +25 -15
- data/test/defs/test_defs_de.rb +52 -61
- data/test/defs/test_defs_dk.rb +31 -19
- data/test/defs/test_defs_ecb_target.rb +14 -10
- data/test/defs/test_defs_ee.rb +28 -20
- data/test/defs/test_defs_el.rb +29 -17
- data/test/defs/test_defs_es.rb +114 -52
- data/test/defs/test_defs_europe.rb +1154 -715
- data/test/defs/test_defs_federal_reserve.rb +99 -57
- data/test/defs/test_defs_fedex.rb +19 -12
- data/test/defs/test_defs_fi.rb +47 -27
- data/test/defs/test_defs_fr.rb +29 -24
- data/test/defs/test_defs_gb.rb +90 -51
- data/test/defs/test_defs_ge.rb +40 -28
- data/test/defs/test_defs_hk.rb +47 -26
- data/test/defs/test_defs_hr.rb +32 -18
- data/test/defs/test_defs_hu.rb +26 -16
- data/test/defs/test_defs_ie.rb +41 -25
- data/test/defs/test_defs_is.rb +39 -22
- data/test/defs/test_defs_it.rb +23 -14
- data/test/defs/test_defs_jp.rb +112 -59
- data/test/defs/test_defs_kr.rb +25 -17
- data/test/defs/test_defs_li.rb +20 -20
- data/test/defs/test_defs_lt.rb +51 -30
- data/test/defs/test_defs_lu.rb +17 -12
- data/test/defs/test_defs_ma.rb +17 -11
- data/test/defs/test_defs_mt_en.rb +28 -19
- data/test/defs/test_defs_mt_mt.rb +28 -19
- data/test/defs/test_defs_mx.rb +33 -22
- data/test/defs/test_defs_my.rb +11 -8
- data/test/defs/test_defs_nerc.rb +17 -11
- data/test/defs/test_defs_nl.rb +21 -13
- data/test/defs/test_defs_no.rb +31 -18
- data/test/defs/test_defs_north_america.rb +507 -393
- data/test/defs/test_defs_nyse.rb +26 -15
- data/test/defs/test_defs_nz.rb +47 -28
- data/test/defs/test_defs_pe.rb +35 -20
- data/test/defs/test_defs_ph.rb +17 -11
- data/test/defs/test_defs_pl.rb +200 -119
- data/test/defs/test_defs_pt.rb +33 -24
- data/test/defs/test_defs_ro.rb +39 -24
- data/test/defs/test_defs_rs_cyrl.rb +33 -26
- data/test/defs/test_defs_rs_la.rb +33 -26
- data/test/defs/test_defs_ru.rb +22 -16
- data/test/defs/test_defs_scandinavia.rb +193 -116
- data/test/defs/test_defs_se.rb +47 -28
- data/test/defs/test_defs_sg.rb +13 -9
- data/test/defs/test_defs_si.rb +93 -24
- data/test/defs/test_defs_sk.rb +29 -17
- data/test/defs/test_defs_tn.rb +15 -10
- data/test/defs/test_defs_tr.rb +39 -30
- data/test/defs/test_defs_united_nations.rb +0 -1
- data/test/defs/test_defs_ups.rb +19 -12
- data/test/defs/test_defs_us.rb +333 -217
- data/test/defs/test_defs_ve.rb +23 -16
- data/test/defs/test_defs_vi.rb +10 -8
- data/test/defs/test_defs_za.rb +23 -14
- data/test/holidays/definition/context/test_generator.rb +40 -13
- data/test/holidays/definition/decorator/test_test.rb +123 -0
- data/test/holidays/definition/generator/test_test.rb +113 -0
- data/test/holidays/definition/parser/test_test.rb +142 -0
- data/test/holidays/definition/validator/test_region.rb +5 -0
- data/test/holidays/definition/validator/test_test.rb +60 -0
- metadata +15 -8
- data/test/holidays/factory/test_date_calculator.rb +0 -32
- data/test/holidays/factory/test_definition.rb +0 -62
- data/test/holidays/factory/test_finder.rb +0 -25
data/test/defs/test_defs_ch.rb
CHANGED
@@ -7,33 +7,39 @@ 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
|
-
|
11
|
-
Date.civil(2012,12,25) => 'Weihnachten',
|
12
|
-
Date.civil(2012,05,17) => 'Auffahrt'
|
13
|
-
}.each do |date, name|
|
14
|
-
assert_equal name, (Holidays.on(date, :ch)[0] || {})[:name]
|
15
|
-
end
|
10
|
+
assert_equal "Bundesfeiertag", (Holidays.on(Date.civil(2012, 8, 1), [:ch])[0] || {})[:name]
|
16
11
|
|
17
|
-
|
18
|
-
Date.civil(2012,12,25) => 'Weihnachten',
|
19
|
-
Date.civil(2012,05,17) => 'Auffahrt',
|
20
|
-
Date.civil(2012,5,1) => 'Tag der Arbeit',
|
21
|
-
Date.civil(2012,12,26) => 'Stefanstag'
|
22
|
-
}.each do |date, name|
|
23
|
-
assert_equal name, (Holidays.on(date, :ch_zh)[0] || {})[:name]
|
24
|
-
end
|
12
|
+
assert_equal "Weihnachten", (Holidays.on(Date.civil(2012, 12, 25), [:ch])[0] || {})[:name]
|
25
13
|
|
26
|
-
|
27
|
-
assert_equal 'Lundi du Jeûne fédéral', (Holidays.on(date, :ch_vd)[0] || {})[:name]
|
28
|
-
end
|
14
|
+
assert_equal "Auffahrt", (Holidays.on(Date.civil(2012, 5, 17), [:ch])[0] || {})[:name]
|
29
15
|
|
30
|
-
|
31
|
-
assert_equal 'Jeûne genevois', (Holidays.on(date, :ch_ge)[0] || {})[:name]
|
32
|
-
end
|
16
|
+
assert_equal "Bundesfeiertag", (Holidays.on(Date.civil(2012, 8, 1), [:ch_zh])[0] || {})[:name]
|
33
17
|
|
34
|
-
|
35
|
-
|
36
|
-
|
18
|
+
assert_equal "Weihnachten", (Holidays.on(Date.civil(2012, 12, 25), [:ch_zh])[0] || {})[:name]
|
19
|
+
|
20
|
+
assert_equal "Auffahrt", (Holidays.on(Date.civil(2012, 5, 17), [:ch_zh])[0] || {})[:name]
|
21
|
+
|
22
|
+
assert_equal "Tag der Arbeit", (Holidays.on(Date.civil(2012, 5, 1), [:ch_zh])[0] || {})[:name]
|
23
|
+
|
24
|
+
assert_equal "Stefanstag", (Holidays.on(Date.civil(2012, 12, 26), [:ch_zh])[0] || {})[:name]
|
25
|
+
|
26
|
+
assert_equal "Lundi du Jeûne fédéral", (Holidays.on(Date.civil(2012, 9, 17), [:ch_vd])[0] || {})[:name]
|
27
|
+
|
28
|
+
assert_equal "Lundi du Jeûne fédéral", (Holidays.on(Date.civil(2013, 9, 16), [:ch_vd])[0] || {})[:name]
|
29
|
+
|
30
|
+
assert_equal "Lundi du Jeûne fédéral", (Holidays.on(Date.civil(2014, 9, 22), [:ch_vd])[0] || {})[:name]
|
31
|
+
|
32
|
+
assert_equal "Jeûne genevois", (Holidays.on(Date.civil(2012, 9, 6), [:ch_ge])[0] || {})[:name]
|
33
|
+
|
34
|
+
assert_equal "Jeûne genevois", (Holidays.on(Date.civil(2013, 9, 5), [:ch_ge])[0] || {})[:name]
|
35
|
+
|
36
|
+
assert_equal "Jeûne genevois", (Holidays.on(Date.civil(2014, 9, 11), [:ch_ge])[0] || {})[:name]
|
37
|
+
|
38
|
+
assert_equal "Näfelser Fahrt", (Holidays.on(Date.civil(2012, 4, 12), [:ch_gl])[0] || {})[:name]
|
39
|
+
|
40
|
+
assert_equal "Näfelser Fahrt", (Holidays.on(Date.civil(2013, 4, 4), [:ch_gl])[0] || {})[:name]
|
41
|
+
|
42
|
+
assert_equal "Näfelser Fahrt", (Holidays.on(Date.civil(2014, 4, 3), [:ch_gl])[0] || {})[:name]
|
37
43
|
|
38
44
|
end
|
39
45
|
end
|
data/test/defs/test_defs_cl.rb
CHANGED
@@ -7,33 +7,55 @@ require File.expand_path(File.dirname(__FILE__)) + '/../test_helper'
|
|
7
7
|
class ClDefinitionTests < Test::Unit::TestCase # :nodoc:
|
8
8
|
|
9
9
|
def test_cl
|
10
|
-
|
11
|
-
|
12
|
-
Date.civil(2011,4,
|
13
|
-
|
14
|
-
Date.civil(
|
15
|
-
|
16
|
-
Date.civil(
|
17
|
-
|
18
|
-
Date.civil(
|
19
|
-
|
20
|
-
Date.civil(
|
21
|
-
|
22
|
-
Date.civil(
|
23
|
-
|
24
|
-
Date.civil(2014,
|
25
|
-
|
26
|
-
Date.civil(2014,
|
27
|
-
|
28
|
-
Date.civil(
|
29
|
-
|
30
|
-
Date.civil(
|
31
|
-
|
32
|
-
Date.civil(
|
33
|
-
|
34
|
-
Date.civil(
|
35
|
-
|
36
|
-
|
10
|
+
assert_equal "Año Nuevo", (Holidays.on(Date.civil(2014, 1, 1), [:cl], [:informal])[0] || {})[:name]
|
11
|
+
|
12
|
+
assert_equal "Viernes Santo", (Holidays.on(Date.civil(2011, 4, 22), [:cl], [:informal])[0] || {})[:name]
|
13
|
+
|
14
|
+
assert_equal "Sábado Santo", (Holidays.on(Date.civil(2011, 4, 23), [:cl], [:informal])[0] || {})[:name]
|
15
|
+
|
16
|
+
assert_equal "Viernes Santo", (Holidays.on(Date.civil(2012, 4, 6), [:cl], [:informal])[0] || {})[:name]
|
17
|
+
|
18
|
+
assert_equal "Sábado Santo", (Holidays.on(Date.civil(2012, 4, 7), [:cl], [:informal])[0] || {})[:name]
|
19
|
+
|
20
|
+
assert_equal "Viernes Santo", (Holidays.on(Date.civil(2013, 3, 29), [:cl], [:informal])[0] || {})[:name]
|
21
|
+
|
22
|
+
assert_equal "Sábado Santo", (Holidays.on(Date.civil(2013, 3, 30), [:cl], [:informal])[0] || {})[:name]
|
23
|
+
|
24
|
+
assert_equal "Viernes Santo", (Holidays.on(Date.civil(2014, 4, 18), [:cl], [:informal])[0] || {})[:name]
|
25
|
+
|
26
|
+
assert_equal "Sábado Santo", (Holidays.on(Date.civil(2014, 4, 19), [:cl], [:informal])[0] || {})[:name]
|
27
|
+
|
28
|
+
assert_equal "Viernes Santo", (Holidays.on(Date.civil(2015, 4, 3), [:cl], [:informal])[0] || {})[:name]
|
29
|
+
|
30
|
+
assert_equal "Sábado Santo", (Holidays.on(Date.civil(2015, 4, 4), [:cl], [:informal])[0] || {})[:name]
|
31
|
+
|
32
|
+
assert_equal "Viernes Santo", (Holidays.on(Date.civil(2016, 3, 25), [:cl], [:informal])[0] || {})[:name]
|
33
|
+
|
34
|
+
assert_equal "Sábado Santo", (Holidays.on(Date.civil(2016, 3, 26), [:cl], [:informal])[0] || {})[:name]
|
35
|
+
|
36
|
+
assert_equal "Día del Trabajo", (Holidays.on(Date.civil(2014, 5, 1), [:cl], [:informal])[0] || {})[:name]
|
37
|
+
|
38
|
+
assert_equal "Día de las Glorias Navales", (Holidays.on(Date.civil(2014, 5, 21), [:cl], [:informal])[0] || {})[:name]
|
39
|
+
|
40
|
+
assert_equal "San Pedro y San Pablo", (Holidays.on(Date.civil(2014, 6, 29), [:cl], [:informal])[0] || {})[:name]
|
41
|
+
|
42
|
+
assert_equal "Día de la Virgen del Carmen", (Holidays.on(Date.civil(2014, 7, 16), [:cl], [:informal])[0] || {})[:name]
|
43
|
+
|
44
|
+
assert_equal "Asunción de la Virgen", (Holidays.on(Date.civil(2014, 8, 15), [:cl], [:informal])[0] || {})[:name]
|
45
|
+
|
46
|
+
assert_equal "Independencia Nacional", (Holidays.on(Date.civil(2014, 9, 18), [:cl], [:informal])[0] || {})[:name]
|
47
|
+
|
48
|
+
assert_equal "Día de las Glorias del Ejército", (Holidays.on(Date.civil(2014, 9, 19), [:cl], [:informal])[0] || {})[:name]
|
49
|
+
|
50
|
+
assert_equal "Encuentro de Dos Mundos", (Holidays.on(Date.civil(2014, 10, 12), [:cl], [:informal])[0] || {})[:name]
|
51
|
+
|
52
|
+
assert_equal "Día de las Iglesias Evangélicas y Protestantes", (Holidays.on(Date.civil(2014, 10, 31), [:cl], [:informal])[0] || {})[:name]
|
53
|
+
|
54
|
+
assert_equal "Día de Todos los Santos", (Holidays.on(Date.civil(2014, 11, 1), [:cl], [:informal])[0] || {})[:name]
|
55
|
+
|
56
|
+
assert_equal "Inmaculada Concepción de María", (Holidays.on(Date.civil(2014, 12, 8), [:cl], [:informal])[0] || {})[:name]
|
57
|
+
|
58
|
+
assert_equal "Navidad", (Holidays.on(Date.civil(2014, 12, 25), [:cl], [:informal])[0] || {})[:name]
|
37
59
|
|
38
60
|
end
|
39
61
|
end
|
data/test/defs/test_defs_cr.rb
CHANGED
@@ -7,17 +7,23 @@ require File.expand_path(File.dirname(__FILE__)) + '/../test_helper'
|
|
7
7
|
class CrDefinitionTests < Test::Unit::TestCase # :nodoc:
|
8
8
|
|
9
9
|
def test_cr
|
10
|
-
|
11
|
-
|
12
|
-
Date.civil(2015,
|
13
|
-
|
14
|
-
Date.civil(2015,
|
15
|
-
|
16
|
-
Date.civil(2015,
|
17
|
-
|
18
|
-
Date.civil(
|
19
|
-
|
20
|
-
|
10
|
+
assert_equal "Año Nuevo", (Holidays.on(Date.civil(2015, 1, 1), [:cr])[0] || {})[:name]
|
11
|
+
|
12
|
+
assert_equal "Día de Juan Santamaría", (Holidays.on(Date.civil(2015, 4, 11), [:cr])[0] || {})[:name]
|
13
|
+
|
14
|
+
assert_equal "Día del Trabajador", (Holidays.on(Date.civil(2015, 5, 1), [:cr])[0] || {})[:name]
|
15
|
+
|
16
|
+
assert_equal "Día de la Anexión de Guanacaste", (Holidays.on(Date.civil(2015, 7, 25), [:cr])[0] || {})[:name]
|
17
|
+
|
18
|
+
assert_equal "Día de la Virgen de los Angeles", (Holidays.on(Date.civil(2015, 8, 2), [:cr])[0] || {})[:name]
|
19
|
+
|
20
|
+
assert_equal "Día de la Madre", (Holidays.on(Date.civil(2015, 8, 15), [:cr])[0] || {})[:name]
|
21
|
+
|
22
|
+
assert_equal "Día de la Independencia", (Holidays.on(Date.civil(2015, 9, 15), [:cr])[0] || {})[:name]
|
23
|
+
|
24
|
+
assert_equal "Día de las Culturas", (Holidays.on(Date.civil(2015, 10, 12), [:cr])[0] || {})[:name]
|
25
|
+
|
26
|
+
assert_equal "Navidad", (Holidays.on(Date.civil(2016, 12, 25), [:cr])[0] || {})[:name]
|
21
27
|
|
22
28
|
end
|
23
29
|
end
|
data/test/defs/test_defs_cz.rb
CHANGED
@@ -7,21 +7,31 @@ require File.expand_path(File.dirname(__FILE__)) + '/../test_helper'
|
|
7
7
|
class CzDefinitionTests < Test::Unit::TestCase # :nodoc:
|
8
8
|
|
9
9
|
def test_cz
|
10
|
-
|
11
|
-
|
12
|
-
Date.civil(
|
13
|
-
|
14
|
-
Date.civil(2010,5,
|
15
|
-
|
16
|
-
Date.civil(2010,
|
17
|
-
|
18
|
-
Date.civil(2010,
|
19
|
-
|
20
|
-
Date.civil(2010,
|
21
|
-
|
22
|
-
Date.civil(2010,
|
23
|
-
|
24
|
-
|
10
|
+
assert_equal "Den obnovy samostatného českého státu", (Holidays.on(Date.civil(2010, 1, 1), [:cz], [:informal])[0] || {})[:name]
|
11
|
+
|
12
|
+
assert_equal "Velký pátek", (Holidays.on(Date.civil(2016, 3, 25), [:cz], [:informal])[0] || {})[:name]
|
13
|
+
|
14
|
+
assert_equal "Velikonoční pondělí", (Holidays.on(Date.civil(2010, 4, 5), [:cz], [:informal])[0] || {})[:name]
|
15
|
+
|
16
|
+
assert_equal "Svátek práce", (Holidays.on(Date.civil(2010, 5, 1), [:cz], [:informal])[0] || {})[:name]
|
17
|
+
|
18
|
+
assert_equal "Den vítězství", (Holidays.on(Date.civil(2010, 5, 8), [:cz], [:informal])[0] || {})[:name]
|
19
|
+
|
20
|
+
assert_equal "Den slovanských věrozvěstů Cyrila a Metoděje", (Holidays.on(Date.civil(2010, 7, 5), [:cz], [:informal])[0] || {})[:name]
|
21
|
+
|
22
|
+
assert_equal "Den upálení mistra Jana Husa", (Holidays.on(Date.civil(2010, 7, 6), [:cz], [:informal])[0] || {})[:name]
|
23
|
+
|
24
|
+
assert_equal "Den české státnosti", (Holidays.on(Date.civil(2010, 9, 28), [:cz], [:informal])[0] || {})[:name]
|
25
|
+
|
26
|
+
assert_equal "Den vzniku samostatného československého státu", (Holidays.on(Date.civil(2010, 10, 28), [:cz], [:informal])[0] || {})[:name]
|
27
|
+
|
28
|
+
assert_equal "Den boje za svobodu a demokracii", (Holidays.on(Date.civil(2010, 11, 17), [:cz], [:informal])[0] || {})[:name]
|
29
|
+
|
30
|
+
assert_equal "Štědrý den", (Holidays.on(Date.civil(2010, 12, 24), [:cz], [:informal])[0] || {})[:name]
|
31
|
+
|
32
|
+
assert_equal "1. svátek vánoční", (Holidays.on(Date.civil(2010, 12, 25), [:cz], [:informal])[0] || {})[:name]
|
33
|
+
|
34
|
+
assert_equal "2. svátek vánoční", (Holidays.on(Date.civil(2010, 12, 26), [:cz], [:informal])[0] || {})[:name]
|
25
35
|
|
26
36
|
end
|
27
37
|
end
|
data/test/defs/test_defs_de.rb
CHANGED
@@ -7,80 +7,71 @@ require File.expand_path(File.dirname(__FILE__)) + '/../test_helper'
|
|
7
7
|
class DeDefinitionTests < Test::Unit::TestCase # :nodoc:
|
8
8
|
|
9
9
|
def test_de
|
10
|
-
|
11
|
-
Date.civil(2009, 4, 10) => 'Karfreitag',
|
12
|
-
Date.civil(2009, 4, 12) => 'Ostersonntag',
|
13
|
-
Date.civil(2009, 4, 13) => 'Ostermontag',
|
14
|
-
Date.civil(2009, 5, 1) => 'Tag der Arbeit',
|
15
|
-
Date.civil(2009, 5, 21) => 'Christi Himmelfahrt',
|
16
|
-
Date.civil(2009, 5, 31) => 'Pfingstsonntag',
|
17
|
-
Date.civil(2009, 6, 1) => 'Pfingstmontag',
|
18
|
-
Date.civil(2009, 10, 3) => 'Tag der Deutschen Einheit',
|
19
|
-
Date.civil(2009, 12, 24) => 'Heilig Abend',
|
20
|
-
Date.civil(2009, 12, 25) => '1. Weihnachtstag',
|
21
|
-
Date.civil(2009, 12, 26) => '2. Weihnachtstag',
|
22
|
-
Date.civil(2009, 12, 31) => 'Silvester' }.each do |date, name|
|
23
|
-
assert_equal name, (Holidays.on(date, :de, :informal)[0] || {})[:name], "Failed on '#{name}' for date '#{date}'"
|
24
|
-
end
|
10
|
+
assert_equal "Neujahrstag", (Holidays.on(Date.civil(2009, 1, 1), [:de], [:informal])[0] || {})[:name]
|
25
11
|
|
26
|
-
|
27
|
-
assert_equal 'Heilige Drei Könige', Holidays.on(Date.civil(2009, 1, 6), r)[0][:name]
|
28
|
-
end
|
12
|
+
assert_equal "Karfreitag", (Holidays.on(Date.civil(2009, 4, 10), [:de], [:informal])[0] || {})[:name]
|
29
13
|
|
30
|
-
assert_equal
|
31
|
-
[:de_bw, :de_by, :de_he, :de_nw, :de_rp, :de_sl, :de_sn_sorbian, :de_th_cath].each do |r|
|
32
|
-
assert_equal 'Fronleichnam', Holidays.on(Date.civil(2017, 6, 15), r)[0][:name]
|
33
|
-
end
|
14
|
+
assert_equal "Ostersonntag", (Holidays.on(Date.civil(2009, 4, 12), [:de], [:informal])[0] || {})[:name]
|
34
15
|
|
35
|
-
assert_equal
|
36
|
-
[:de_by_cath, :de_by_augsburg, :de_sl].each do |r|
|
37
|
-
assert_equal 'Mariä Himmelfahrt', Holidays.on(Date.civil(2017, 8, 15), r)[0][:name]
|
38
|
-
end
|
16
|
+
assert_equal "Ostermontag", (Holidays.on(Date.civil(2009, 4, 13), [:de], [:informal])[0] || {})[:name]
|
39
17
|
|
40
|
-
|
41
|
-
assert_equal 'Reformationstag', Holidays.on(Date.civil(2017, 10, 31), r)[0][:name]
|
42
|
-
end
|
18
|
+
assert_equal "Tag der Arbeit", (Holidays.on(Date.civil(2009, 5, 1), [:de], [:informal])[0] || {})[:name]
|
43
19
|
|
44
|
-
|
45
|
-
[:de_bw].each do |r|
|
46
|
-
assert_equal 'Reformationstag', Holidays.on(Date.civil(2009, 10, 31), r, :informal)[0][:name]
|
47
|
-
end
|
20
|
+
assert_equal "Christi Himmelfahrt", (Holidays.on(Date.civil(2009, 5, 21), [:de], [:informal])[0] || {})[:name]
|
48
21
|
|
49
|
-
|
50
|
-
assert_equal 'Reformationstag', Holidays.on(Date.civil(2017, 10, 31), :de)[0][:name]
|
51
|
-
assert_equal [], Holidays.on(Date.civil(2016, 10, 31), :de), "Reformationstag is not a holiday in 2016 in whole Germany"
|
52
|
-
assert_equal [], Holidays.on(Date.civil(2018, 10, 31), :de), "Reformationstag is not a holiday in 2018 in whole Germany"
|
22
|
+
assert_equal "Pfingstsonntag", (Holidays.on(Date.civil(2009, 5, 31), [:de], [:informal])[0] || {})[:name]
|
53
23
|
|
54
|
-
|
55
|
-
assert_equal 'Allerheiligen', Holidays.on(Date.civil(2009, 11, 1), r)[0][:name]
|
56
|
-
end
|
24
|
+
assert_equal "Pfingstmontag", (Holidays.on(Date.civil(2009, 6, 1), [:de], [:informal])[0] || {})[:name]
|
57
25
|
|
58
|
-
[:
|
59
|
-
assert_equal 'Friedensfest', Holidays.on(Date.civil(2015, 8, 8), r)[0][:name]
|
60
|
-
end
|
26
|
+
assert_equal "Tag der Deutschen Einheit", (Holidays.on(Date.civil(2009, 10, 3), [:de], [:informal])[0] || {})[:name]
|
61
27
|
|
62
|
-
[:de,
|
63
|
-
:de_bw, :de_by, :de_bb, :de_he, :de_mv,
|
64
|
-
:de_nw, :de_rp, :de_sl, :de_sn, :de_st, :de_th].each do |r|
|
65
|
-
assert_equal [], Holidays.on(Date.civil(2015, 8, 8), r), "Friedensfest is not a holiday in #{r}"
|
66
|
-
end
|
28
|
+
assert_equal "Heilig Abend", (Holidays.on(Date.civil(2009, 12, 24), [:de], [:informal])[0] || {})[:name]
|
67
29
|
|
68
|
-
assert_equal
|
30
|
+
assert_equal "1. Weihnachtstag", (Holidays.on(Date.civil(2009, 12, 25), [:de], [:informal])[0] || {})[:name]
|
69
31
|
|
70
|
-
assert_equal
|
32
|
+
assert_equal "2. Weihnachtstag", (Holidays.on(Date.civil(2009, 12, 26), [:de], [:informal])[0] || {})[:name]
|
71
33
|
|
72
|
-
|
73
|
-
assert_equal 'Buß- und Bettag', Holidays.on(Date.civil(2004, 11, 17), :de_sn)[0][:name]
|
74
|
-
assert_equal 'Buß- und Bettag', Holidays.on(Date.civil(2005, 11, 16), :de_sn)[0][:name]
|
75
|
-
assert_equal 'Buß- und Bettag', Holidays.on(Date.civil(2006, 11, 22), :de_sn)[0][:name]
|
76
|
-
assert_equal 'Buß- und Bettag', Holidays.on(Date.civil(2009, 11, 18), :de_sn)[0][:name]
|
34
|
+
assert_equal "Silvester", (Holidays.on(Date.civil(2009, 12, 31), [:de], [:informal])[0] || {})[:name]
|
77
35
|
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
36
|
+
assert_equal "Heilige Drei Könige", (Holidays.on(Date.civil(2009, 1, 6), [:de_bw, :de_by, :de_st, :de_])[0] || {})[:name]
|
37
|
+
|
38
|
+
assert_equal "Fronleichnam", (Holidays.on(Date.civil(2009, 6, 11), [:de_bw, :de_by, :de_he, :de_nw, :de_rp, :de_sl, :de_sn_sorbian, :de_th_cath])[0] || {})[:name]
|
39
|
+
|
40
|
+
assert_equal "Mariä Himmelfahrt", (Holidays.on(Date.civil(2009, 8, 15), [:de_by, :de_sl, :de_])[0] || {})[:name]
|
41
|
+
|
42
|
+
assert_equal "Reformationstag", (Holidays.on(Date.civil(2009, 10, 31), [:de_bb, :de_mv, :de_sn, :de_st, :de_th, :de_])[0] || {})[:name]
|
43
|
+
|
44
|
+
assert_equal "Reformationstag", (Holidays.on(Date.civil(2009, 10, 31), [:de_bw], [:informal])[0] || {})[:name]
|
45
|
+
|
46
|
+
assert_equal "Reformationstag", (Holidays.on(Date.civil(2017, 10, 31), [:de])[0] || {})[:name]
|
47
|
+
|
48
|
+
assert_nil (Holidays.on(Date.civil(2016, 10, 31), [:de])[0] || {})[:name]
|
49
|
+
|
50
|
+
assert_nil (Holidays.on(Date.civil(2018, 10, 31), [:de])[0] || {})[:name]
|
51
|
+
|
52
|
+
assert_equal "Allerheiligen", (Holidays.on(Date.civil(2009, 11, 1), [:de_bw, :de_by, :de_nw, :de_rp, :de_sl, :de_])[0] || {})[:name]
|
53
|
+
|
54
|
+
assert_equal "Friedensfest", (Holidays.on(Date.civil(2015, 8, 8), [:de_by_augsburg])[0] || {})[:name]
|
55
|
+
|
56
|
+
assert_nil (Holidays.on(Date.civil(2015, 8, 8), [:de, :de_bw, :de_by, :de_bb, :de_he, :de_mv, :de_nw, :de_rp, :de_sl, :de_sn, :de_st, :de_th])[0] || {})[:name]
|
57
|
+
|
58
|
+
assert_nil (Holidays.on(Date.civil(2010, 5, 8), [:de])[0] || {})[:name]
|
59
|
+
|
60
|
+
assert_nil (Holidays.on(Date.civil(2010, 8, 8), [:de])[0] || {})[:name]
|
61
|
+
|
62
|
+
assert_equal "Buß- und Bettag", (Holidays.on(Date.civil(2004, 11, 17), [:de_sn])[0] || {})[:name]
|
63
|
+
|
64
|
+
assert_equal "Buß- und Bettag", (Holidays.on(Date.civil(2005, 11, 16), [:de_sn])[0] || {})[:name]
|
65
|
+
|
66
|
+
assert_equal "Buß- und Bettag", (Holidays.on(Date.civil(2006, 11, 22), [:de_sn])[0] || {})[:name]
|
67
|
+
|
68
|
+
assert_equal "Buß- und Bettag", (Holidays.on(Date.civil(2009, 11, 18), [:de_sn])[0] || {})[:name]
|
69
|
+
|
70
|
+
assert_equal "Weiberfastnacht", (Holidays.on(Date.civil(2016, 2, 4), [:de_bw, :de_by, :de_he, :de_nw, :de_rp, :de_sl, :de_sn], [:informal])[0] || {})[:name]
|
71
|
+
|
72
|
+
assert_equal "Rosenmontag", (Holidays.on(Date.civil(2016, 2, 8), [:de_bw, :de_by, :de_he, :de_nw, :de_rp, :de_sl, :de_sn], [:informal])[0] || {})[:name]
|
73
|
+
|
74
|
+
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]
|
84
75
|
|
85
76
|
end
|
86
77
|
end
|
data/test/defs/test_defs_dk.rb
CHANGED
@@ -7,25 +7,37 @@ require File.expand_path(File.dirname(__FILE__)) + '/../test_helper'
|
|
7
7
|
class DkDefinitionTests < Test::Unit::TestCase # :nodoc:
|
8
8
|
|
9
9
|
def test_dk
|
10
|
-
|
11
|
-
|
12
|
-
Date.civil(2007,
|
13
|
-
|
14
|
-
Date.civil(2007,4,
|
15
|
-
|
16
|
-
Date.civil(2007,4,
|
17
|
-
|
18
|
-
Date.civil(2007,5,
|
19
|
-
|
20
|
-
Date.civil(2007,
|
21
|
-
|
22
|
-
Date.civil(2007,
|
23
|
-
|
24
|
-
Date.civil(2007,
|
25
|
-
|
26
|
-
Date.civil(2007,
|
27
|
-
|
28
|
-
|
10
|
+
assert_equal "Nytårsdag", (Holidays.on(Date.civil(2007, 1, 1), [:dk], [:informal])[0] || {})[:name]
|
11
|
+
|
12
|
+
assert_equal "Fastelavn", (Holidays.on(Date.civil(2007, 2, 18), [:dk], [:informal])[0] || {})[:name]
|
13
|
+
|
14
|
+
assert_equal "2. påskedag", (Holidays.on(Date.civil(2007, 4, 9), [:dk], [:informal])[0] || {})[:name]
|
15
|
+
|
16
|
+
assert_equal "Dronningens fødselsdag", (Holidays.on(Date.civil(2007, 4, 16), [:dk], [:informal])[0] || {})[:name]
|
17
|
+
|
18
|
+
assert_equal "Skærtorsdag", (Holidays.on(Date.civil(2007, 4, 5), [:dk], [:informal])[0] || {})[:name]
|
19
|
+
|
20
|
+
assert_equal "Langfredag", (Holidays.on(Date.civil(2007, 4, 6), [:dk], [:informal])[0] || {})[:name]
|
21
|
+
|
22
|
+
assert_equal "Påskedag", (Holidays.on(Date.civil(2007, 4, 8), [:dk], [:informal])[0] || {})[:name]
|
23
|
+
|
24
|
+
assert_equal "Arbejdernes kampdag", (Holidays.on(Date.civil(2007, 5, 1), [:dk], [:informal])[0] || {})[:name]
|
25
|
+
|
26
|
+
assert_equal "Store Bededag", (Holidays.on(Date.civil(2007, 5, 4), [:dk], [:informal])[0] || {})[:name]
|
27
|
+
|
28
|
+
assert_equal "Kristi Himmelfartsdag", (Holidays.on(Date.civil(2007, 5, 17), [:dk], [:informal])[0] || {})[:name]
|
29
|
+
|
30
|
+
assert_equal "Pinsedag", (Holidays.on(Date.civil(2007, 5, 27), [:dk], [:informal])[0] || {})[:name]
|
31
|
+
|
32
|
+
assert_equal "2. Pinsedag", (Holidays.on(Date.civil(2007, 5, 28), [:dk], [:informal])[0] || {})[:name]
|
33
|
+
|
34
|
+
assert_equal "Grundlovsdag", (Holidays.on(Date.civil(2007, 6, 5), [:dk], [:informal])[0] || {})[:name]
|
35
|
+
|
36
|
+
assert_equal "Juleaftensdag", (Holidays.on(Date.civil(2007, 12, 24), [:dk], [:informal])[0] || {})[:name]
|
37
|
+
|
38
|
+
assert_equal "1. juledag", (Holidays.on(Date.civil(2007, 12, 25), [:dk], [:informal])[0] || {})[:name]
|
39
|
+
|
40
|
+
assert_equal "2. juledag", (Holidays.on(Date.civil(2007, 12, 26), [:dk], [:informal])[0] || {})[:name]
|
29
41
|
|
30
42
|
end
|
31
43
|
end
|
@@ -7,17 +7,21 @@ require File.expand_path(File.dirname(__FILE__)) + '/../test_helper'
|
|
7
7
|
class Ecb_targetDefinitionTests < Test::Unit::TestCase # :nodoc:
|
8
8
|
|
9
9
|
def test_ecb_target
|
10
|
-
|
11
|
-
|
12
|
-
Date.civil(2013,
|
13
|
-
|
14
|
-
Date.civil(2013,
|
15
|
-
|
16
|
-
|
17
|
-
|
10
|
+
assert_equal "New Year's Day", (Holidays.on(Date.civil(2013, 1, 1), [:ecb_target])[0] || {})[:name]
|
11
|
+
|
12
|
+
assert_equal "Labour Day", (Holidays.on(Date.civil(2013, 5, 1), [:ecb_target])[0] || {})[:name]
|
13
|
+
|
14
|
+
assert_equal "Good Friday", (Holidays.on(Date.civil(2013, 3, 29), [:ecb_target])[0] || {})[:name]
|
15
|
+
|
16
|
+
assert_equal "Easter Monday", (Holidays.on(Date.civil(2013, 4, 1), [:ecb_target])[0] || {})[:name]
|
17
|
+
|
18
|
+
assert_equal "Christmas Day", (Holidays.on(Date.civil(2013, 12, 25), [:ecb_target])[0] || {})[:name]
|
19
|
+
|
20
|
+
assert_equal "Christmas Holiday", (Holidays.on(Date.civil(2013, 12, 26), [:ecb_target])[0] || {})[:name]
|
21
|
+
|
22
|
+
assert_equal "Good Friday", (Holidays.on(Date.civil(2013, 3, 29), [:ecb_target])[0] || {})[:name]
|
18
23
|
|
19
|
-
assert_equal
|
20
|
-
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), [:ecb_target])[0] || {})[:name]
|
21
25
|
|
22
26
|
end
|
23
27
|
end
|