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_se.rb
CHANGED
@@ -7,34 +7,53 @@ require File.expand_path(File.dirname(__FILE__)) + '/../test_helper'
|
|
7
7
|
class SeDefinitionTests < Test::Unit::TestCase # :nodoc:
|
8
8
|
|
9
9
|
def test_se
|
10
|
-
|
11
|
-
|
12
|
-
Date.civil(2008,
|
13
|
-
|
14
|
-
Date.civil(2008,3,
|
15
|
-
|
16
|
-
Date.civil(2008,
|
17
|
-
|
18
|
-
Date.civil(2008,
|
19
|
-
|
20
|
-
Date.civil(
|
21
|
-
|
22
|
-
Date.civil(
|
23
|
-
|
24
|
-
Date.civil(
|
25
|
-
|
26
|
-
Date.civil(2008,6,
|
27
|
-
|
28
|
-
Date.civil(
|
29
|
-
|
30
|
-
Date.civil(
|
31
|
-
|
32
|
-
Date.civil(
|
33
|
-
|
34
|
-
Date.civil(
|
35
|
-
|
36
|
-
|
37
|
-
|
10
|
+
assert_equal "Nyårsdagen", (Holidays.on(Date.civil(2008, 1, 1), [:se], [:informal])[0] || {})[:name]
|
11
|
+
|
12
|
+
assert_equal "Trettondedag jul", (Holidays.on(Date.civil(2008, 1, 6), [:se], [:informal])[0] || {})[:name]
|
13
|
+
|
14
|
+
assert_equal "Långfredagen", (Holidays.on(Date.civil(2008, 3, 21), [:se], [:informal])[0] || {})[:name]
|
15
|
+
|
16
|
+
assert_equal "Påskafton", (Holidays.on(Date.civil(2008, 3, 22), [:se], [:informal])[0] || {})[:name]
|
17
|
+
|
18
|
+
assert_equal "Påskdagen", (Holidays.on(Date.civil(2008, 3, 23), [:se], [:informal])[0] || {})[:name]
|
19
|
+
|
20
|
+
assert_equal "Annandag påsk", (Holidays.on(Date.civil(2008, 3, 24), [:se], [:informal])[0] || {})[:name]
|
21
|
+
|
22
|
+
assert_equal "Kristi himmelsfärdsdag", (Holidays.on(Date.civil(2008, 5, 1), [:se], [:informal])[0] || {})[:name]
|
23
|
+
|
24
|
+
assert_equal "Pingstdagen", (Holidays.on(Date.civil(2008, 5, 11), [:se], [:informal])[0] || {})[:name]
|
25
|
+
|
26
|
+
assert_equal "Nationaldagen", (Holidays.on(Date.civil(2008, 6, 6), [:se], [:informal])[0] || {})[:name]
|
27
|
+
|
28
|
+
assert_equal "Midsommardagen", (Holidays.on(Date.civil(2005, 6, 25), [:se], [:informal])[0] || {})[:name]
|
29
|
+
|
30
|
+
assert_equal "Midsommardagen", (Holidays.on(Date.civil(2006, 6, 24), [:se], [:informal])[0] || {})[:name]
|
31
|
+
|
32
|
+
assert_equal "Midsommarafton", (Holidays.on(Date.civil(2006, 6, 23), [:se], [:informal])[0] || {})[:name]
|
33
|
+
|
34
|
+
assert_equal "Midsommardagen", (Holidays.on(Date.civil(2007, 6, 23), [:se], [:informal])[0] || {})[:name]
|
35
|
+
|
36
|
+
assert_equal "Midsommarafton", (Holidays.on(Date.civil(2007, 6, 22), [:se], [:informal])[0] || {})[:name]
|
37
|
+
|
38
|
+
assert_equal "Midsommardagen", (Holidays.on(Date.civil(2008, 6, 21), [:se], [:informal])[0] || {})[:name]
|
39
|
+
|
40
|
+
assert_equal "Midsommarafton", (Holidays.on(Date.civil(2008, 6, 20), [:se], [:informal])[0] || {})[:name]
|
41
|
+
|
42
|
+
assert_equal "Alla helgons dag", (Holidays.on(Date.civil(2005, 11, 5), [:se], [:informal])[0] || {})[:name]
|
43
|
+
|
44
|
+
assert_equal "Alla helgons dag", (Holidays.on(Date.civil(2006, 11, 4), [:se], [:informal])[0] || {})[:name]
|
45
|
+
|
46
|
+
assert_equal "Alla helgons dag", (Holidays.on(Date.civil(2007, 11, 3), [:se], [:informal])[0] || {})[:name]
|
47
|
+
|
48
|
+
assert_equal "Alla helgons dag", (Holidays.on(Date.civil(2008, 11, 1), [:se], [:informal])[0] || {})[:name]
|
49
|
+
|
50
|
+
assert_equal "Julafton", (Holidays.on(Date.civil(2008, 12, 24), [:se], [:informal])[0] || {})[:name]
|
51
|
+
|
52
|
+
assert_equal "Juldagen", (Holidays.on(Date.civil(2008, 12, 25), [:se], [:informal])[0] || {})[:name]
|
53
|
+
|
54
|
+
assert_equal "Annandag jul", (Holidays.on(Date.civil(2008, 12, 26), [:se], [:informal])[0] || {})[:name]
|
55
|
+
|
56
|
+
assert_equal "Nyårsafton", (Holidays.on(Date.civil(2008, 12, 31), [:se], [:informal])[0] || {})[:name]
|
38
57
|
|
39
58
|
end
|
40
59
|
end
|
data/test/defs/test_defs_sg.rb
CHANGED
@@ -7,15 +7,19 @@ require File.expand_path(File.dirname(__FILE__)) + '/../test_helper'
|
|
7
7
|
class SgDefinitionTests < Test::Unit::TestCase # :nodoc:
|
8
8
|
|
9
9
|
def test_sg
|
10
|
-
|
11
|
-
|
12
|
-
Date.civil(2014,2,
|
13
|
-
|
14
|
-
Date.civil(2014,
|
15
|
-
|
16
|
-
Date.civil(2014,
|
17
|
-
|
18
|
-
|
10
|
+
assert_equal "New Year's Day", (Holidays.on(Date.civil(2014, 1, 1), [:sg], [:informal])[0] || {})[:name]
|
11
|
+
|
12
|
+
assert_equal "Valentine's Day", (Holidays.on(Date.civil(2014, 2, 14), [:sg], [:informal])[0] || {})[:name]
|
13
|
+
|
14
|
+
assert_equal "Total Defence Day", (Holidays.on(Date.civil(2014, 2, 15), [:sg], [:informal])[0] || {})[:name]
|
15
|
+
|
16
|
+
assert_equal "Good Friday", (Holidays.on(Date.civil(2014, 4, 18), [:sg], [:informal])[0] || {})[:name]
|
17
|
+
|
18
|
+
assert_equal "Labour Day", (Holidays.on(Date.civil(2014, 5, 1), [:sg], [:informal])[0] || {})[:name]
|
19
|
+
|
20
|
+
assert_equal "National Day", (Holidays.on(Date.civil(2014, 8, 9), [:sg], [:informal])[0] || {})[:name]
|
21
|
+
|
22
|
+
assert_equal "Christmas Day", (Holidays.on(Date.civil(2014, 12, 25), [:sg], [:informal])[0] || {})[:name]
|
19
23
|
|
20
24
|
end
|
21
25
|
end
|
data/test/defs/test_defs_si.rb
CHANGED
@@ -7,30 +7,99 @@ require File.expand_path(File.dirname(__FILE__)) + '/../test_helper'
|
|
7
7
|
class SiDefinitionTests < Test::Unit::TestCase # :nodoc:
|
8
8
|
|
9
9
|
def test_si
|
10
|
-
assert_equal
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
assert_equal
|
15
|
-
|
16
|
-
assert_equal
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
10
|
+
assert_equal "velikonočna nedelja", (Holidays.on(Date.civil(2015, 4, 5), [:si])[0] || {})[:name]
|
11
|
+
|
12
|
+
assert_equal "velikonočna nedelja", (Holidays.on(Date.civil(2016, 3, 27), [:si])[0] || {})[:name]
|
13
|
+
|
14
|
+
assert_equal "velikonočni ponedeljek", (Holidays.on(Date.civil(2015, 4, 6), [:si])[0] || {})[:name]
|
15
|
+
|
16
|
+
assert_equal "velikonočni ponedeljek", (Holidays.on(Date.civil(2016, 3, 28), [:si])[0] || {})[:name]
|
17
|
+
|
18
|
+
assert_equal "binkošti", (Holidays.on(Date.civil(2015, 5, 24), [:si])[0] || {})[:name]
|
19
|
+
|
20
|
+
assert_equal "binkošti", (Holidays.on(Date.civil(2016, 5, 15), [:si])[0] || {})[:name]
|
21
|
+
|
22
|
+
assert_equal "novo leto", (Holidays.on(Date.civil(2014, 1, 1), [:si], [:informal])[0] || {})[:name]
|
23
|
+
assert_equal "novo leto", (Holidays.on(Date.civil(2015, 1, 1), [:si], [:informal])[0] || {})[:name]
|
24
|
+
assert_equal "novo leto", (Holidays.on(Date.civil(2016, 1, 1), [:si], [:informal])[0] || {})[:name]
|
25
|
+
assert_equal "novo leto", (Holidays.on(Date.civil(2017, 1, 1), [:si], [:informal])[0] || {})[:name]
|
26
|
+
assert_equal "novo leto", (Holidays.on(Date.civil(2018, 1, 1), [:si], [:informal])[0] || {})[:name]
|
27
|
+
assert_equal "novo leto", (Holidays.on(Date.civil(2019, 1, 1), [:si], [:informal])[0] || {})[:name]
|
28
|
+
assert_equal "novo leto", (Holidays.on(Date.civil(2020, 1, 1), [:si], [:informal])[0] || {})[:name]
|
29
|
+
|
30
|
+
assert_equal "Prešernov dan, slovenski kulturni praznik", (Holidays.on(Date.civil(2014, 2, 8), [:si], [:informal])[0] || {})[:name]
|
31
|
+
assert_equal "Prešernov dan, slovenski kulturni praznik", (Holidays.on(Date.civil(2015, 2, 8), [:si], [:informal])[0] || {})[:name]
|
32
|
+
assert_equal "Prešernov dan, slovenski kulturni praznik", (Holidays.on(Date.civil(2016, 2, 8), [:si], [:informal])[0] || {})[:name]
|
33
|
+
assert_equal "Prešernov dan, slovenski kulturni praznik", (Holidays.on(Date.civil(2017, 2, 8), [:si], [:informal])[0] || {})[:name]
|
34
|
+
assert_equal "Prešernov dan, slovenski kulturni praznik", (Holidays.on(Date.civil(2018, 2, 8), [:si], [:informal])[0] || {})[:name]
|
35
|
+
assert_equal "Prešernov dan, slovenski kulturni praznik", (Holidays.on(Date.civil(2019, 2, 8), [:si], [:informal])[0] || {})[:name]
|
36
|
+
assert_equal "Prešernov dan, slovenski kulturni praznik", (Holidays.on(Date.civil(2020, 2, 8), [:si], [:informal])[0] || {})[:name]
|
37
|
+
|
38
|
+
assert_equal "dan upora proti okupatorju", (Holidays.on(Date.civil(2014, 4, 27), [:si], [:informal])[0] || {})[:name]
|
39
|
+
assert_equal "dan upora proti okupatorju", (Holidays.on(Date.civil(2015, 4, 27), [:si], [:informal])[0] || {})[:name]
|
40
|
+
assert_equal "dan upora proti okupatorju", (Holidays.on(Date.civil(2016, 4, 27), [:si], [:informal])[0] || {})[:name]
|
41
|
+
assert_equal "dan upora proti okupatorju", (Holidays.on(Date.civil(2017, 4, 27), [:si], [:informal])[0] || {})[:name]
|
42
|
+
assert_equal "dan upora proti okupatorju", (Holidays.on(Date.civil(2018, 4, 27), [:si], [:informal])[0] || {})[:name]
|
43
|
+
assert_equal "dan upora proti okupatorju", (Holidays.on(Date.civil(2019, 4, 27), [:si], [:informal])[0] || {})[:name]
|
44
|
+
assert_equal "dan upora proti okupatorju", (Holidays.on(Date.civil(2020, 4, 27), [:si], [:informal])[0] || {})[:name]
|
45
|
+
|
46
|
+
assert_equal "praznik dela", (Holidays.on(Date.civil(2014, 5, 1), [:si], [:informal])[0] || {})[:name]
|
47
|
+
assert_equal "praznik dela", (Holidays.on(Date.civil(2015, 5, 1), [:si], [:informal])[0] || {})[:name]
|
48
|
+
assert_equal "praznik dela", (Holidays.on(Date.civil(2016, 5, 1), [:si], [:informal])[0] || {})[:name]
|
49
|
+
assert_equal "praznik dela", (Holidays.on(Date.civil(2017, 5, 1), [:si], [:informal])[0] || {})[:name]
|
50
|
+
assert_equal "praznik dela", (Holidays.on(Date.civil(2018, 5, 1), [:si], [:informal])[0] || {})[:name]
|
51
|
+
assert_equal "praznik dela", (Holidays.on(Date.civil(2019, 5, 1), [:si], [:informal])[0] || {})[:name]
|
52
|
+
assert_equal "praznik dela", (Holidays.on(Date.civil(2020, 5, 1), [:si], [:informal])[0] || {})[:name]
|
53
|
+
|
54
|
+
assert_equal "praznik dela", (Holidays.on(Date.civil(2014, 5, 2), [:si], [:informal])[0] || {})[:name]
|
55
|
+
assert_equal "praznik dela", (Holidays.on(Date.civil(2015, 5, 2), [:si], [:informal])[0] || {})[:name]
|
56
|
+
assert_equal "praznik dela", (Holidays.on(Date.civil(2016, 5, 2), [:si], [:informal])[0] || {})[:name]
|
57
|
+
assert_equal "praznik dela", (Holidays.on(Date.civil(2017, 5, 2), [:si], [:informal])[0] || {})[:name]
|
58
|
+
assert_equal "praznik dela", (Holidays.on(Date.civil(2018, 5, 2), [:si], [:informal])[0] || {})[:name]
|
59
|
+
assert_equal "praznik dela", (Holidays.on(Date.civil(2019, 5, 2), [:si], [:informal])[0] || {})[:name]
|
60
|
+
assert_equal "praznik dela", (Holidays.on(Date.civil(2020, 5, 2), [:si], [:informal])[0] || {})[:name]
|
61
|
+
|
62
|
+
assert_equal "dan državnosti", (Holidays.on(Date.civil(2014, 6, 25), [:si], [:informal])[0] || {})[:name]
|
63
|
+
assert_equal "dan državnosti", (Holidays.on(Date.civil(2015, 6, 25), [:si], [:informal])[0] || {})[:name]
|
64
|
+
assert_equal "dan državnosti", (Holidays.on(Date.civil(2016, 6, 25), [:si], [:informal])[0] || {})[:name]
|
65
|
+
assert_equal "dan državnosti", (Holidays.on(Date.civil(2017, 6, 25), [:si], [:informal])[0] || {})[:name]
|
66
|
+
assert_equal "dan državnosti", (Holidays.on(Date.civil(2018, 6, 25), [:si], [:informal])[0] || {})[:name]
|
67
|
+
assert_equal "dan državnosti", (Holidays.on(Date.civil(2019, 6, 25), [:si], [:informal])[0] || {})[:name]
|
68
|
+
assert_equal "dan državnosti", (Holidays.on(Date.civil(2020, 6, 25), [:si], [:informal])[0] || {})[:name]
|
69
|
+
|
70
|
+
assert_equal "Marijino vnebovzetje", (Holidays.on(Date.civil(2014, 8, 15), [:si], [:informal])[0] || {})[:name]
|
71
|
+
assert_equal "Marijino vnebovzetje", (Holidays.on(Date.civil(2015, 8, 15), [:si], [:informal])[0] || {})[:name]
|
72
|
+
assert_equal "Marijino vnebovzetje", (Holidays.on(Date.civil(2016, 8, 15), [:si], [:informal])[0] || {})[:name]
|
73
|
+
assert_equal "Marijino vnebovzetje", (Holidays.on(Date.civil(2017, 8, 15), [:si], [:informal])[0] || {})[:name]
|
74
|
+
assert_equal "Marijino vnebovzetje", (Holidays.on(Date.civil(2018, 8, 15), [:si], [:informal])[0] || {})[:name]
|
75
|
+
assert_equal "Marijino vnebovzetje", (Holidays.on(Date.civil(2019, 8, 15), [:si], [:informal])[0] || {})[:name]
|
76
|
+
assert_equal "Marijino vnebovzetje", (Holidays.on(Date.civil(2020, 8, 15), [:si], [:informal])[0] || {})[:name]
|
77
|
+
|
78
|
+
assert_equal "dan reformacije", (Holidays.on(Date.civil(2014, 10, 31), [:si], [:informal])[0] || {})[:name]
|
79
|
+
assert_equal "dan reformacije", (Holidays.on(Date.civil(2015, 10, 31), [:si], [:informal])[0] || {})[:name]
|
80
|
+
assert_equal "dan reformacije", (Holidays.on(Date.civil(2016, 10, 31), [:si], [:informal])[0] || {})[:name]
|
81
|
+
assert_equal "dan reformacije", (Holidays.on(Date.civil(2017, 10, 31), [:si], [:informal])[0] || {})[:name]
|
82
|
+
assert_equal "dan reformacije", (Holidays.on(Date.civil(2018, 10, 31), [:si], [:informal])[0] || {})[:name]
|
83
|
+
assert_equal "dan reformacije", (Holidays.on(Date.civil(2019, 10, 31), [:si], [:informal])[0] || {})[:name]
|
84
|
+
assert_equal "dan reformacije", (Holidays.on(Date.civil(2020, 10, 31), [:si], [:informal])[0] || {})[:name]
|
85
|
+
|
86
|
+
assert_equal "dan spomina na mrtve", (Holidays.on(Date.civil(2014, 11, 1), [:si], [:informal])[0] || {})[:name]
|
87
|
+
assert_equal "dan spomina na mrtve", (Holidays.on(Date.civil(2015, 11, 1), [:si], [:informal])[0] || {})[:name]
|
88
|
+
assert_equal "dan spomina na mrtve", (Holidays.on(Date.civil(2016, 11, 1), [:si], [:informal])[0] || {})[:name]
|
89
|
+
assert_equal "dan spomina na mrtve", (Holidays.on(Date.civil(2017, 11, 1), [:si], [:informal])[0] || {})[:name]
|
90
|
+
assert_equal "dan spomina na mrtve", (Holidays.on(Date.civil(2018, 11, 1), [:si], [:informal])[0] || {})[:name]
|
91
|
+
assert_equal "dan spomina na mrtve", (Holidays.on(Date.civil(2019, 11, 1), [:si], [:informal])[0] || {})[:name]
|
92
|
+
assert_equal "dan spomina na mrtve", (Holidays.on(Date.civil(2020, 11, 1), [:si], [:informal])[0] || {})[:name]
|
93
|
+
|
94
|
+
assert_equal "božič", (Holidays.on(Date.civil(2014, 12, 25), [:si], [:informal])[0] || {})[:name]
|
95
|
+
assert_equal "božič", (Holidays.on(Date.civil(2015, 12, 25), [:si], [:informal])[0] || {})[:name]
|
96
|
+
assert_equal "božič", (Holidays.on(Date.civil(2016, 12, 25), [:si], [:informal])[0] || {})[:name]
|
97
|
+
assert_equal "božič", (Holidays.on(Date.civil(2017, 12, 25), [:si], [:informal])[0] || {})[:name]
|
98
|
+
assert_equal "božič", (Holidays.on(Date.civil(2018, 12, 25), [:si], [:informal])[0] || {})[:name]
|
99
|
+
assert_equal "božič", (Holidays.on(Date.civil(2019, 12, 25), [:si], [:informal])[0] || {})[:name]
|
100
|
+
assert_equal "božič", (Holidays.on(Date.civil(2020, 12, 25), [:si], [:informal])[0] || {})[:name]
|
101
|
+
|
102
|
+
assert_equal "dan samostojnosti in enotnosti", (Holidays.on(Date.civil(2008, 12, 26), [:si], [:informal])[0] || {})[:name]
|
34
103
|
|
35
104
|
end
|
36
105
|
end
|
data/test/defs/test_defs_sk.rb
CHANGED
@@ -7,23 +7,35 @@ require File.expand_path(File.dirname(__FILE__)) + '/../test_helper'
|
|
7
7
|
class SkDefinitionTests < Test::Unit::TestCase # :nodoc:
|
8
8
|
|
9
9
|
def test_sk
|
10
|
-
|
11
|
-
|
12
|
-
Date.civil(2013,
|
13
|
-
|
14
|
-
Date.civil(2013,
|
15
|
-
|
16
|
-
Date.civil(2013,
|
17
|
-
|
18
|
-
Date.civil(2013,
|
19
|
-
|
20
|
-
Date.civil(2013,
|
21
|
-
|
22
|
-
Date.civil(2013,
|
23
|
-
|
24
|
-
Date.civil(2013,
|
25
|
-
|
26
|
-
|
10
|
+
assert_equal "Nový rok", (Holidays.on(Date.civil(2013, 1, 1), [:sk], [:informal])[0] || {})[:name]
|
11
|
+
|
12
|
+
assert_equal "Zjavenie Pána (Traja králi)", (Holidays.on(Date.civil(2013, 1, 6), [:sk], [:informal])[0] || {})[:name]
|
13
|
+
|
14
|
+
assert_equal "Veľký piatok", (Holidays.on(Date.civil(2013, 3, 29), [:sk], [:informal])[0] || {})[:name]
|
15
|
+
|
16
|
+
assert_equal "Veľkonočný pondelok", (Holidays.on(Date.civil(2013, 4, 1), [:sk], [:informal])[0] || {})[:name]
|
17
|
+
|
18
|
+
assert_equal "Sviatok práce", (Holidays.on(Date.civil(2013, 5, 1), [:sk], [:informal])[0] || {})[:name]
|
19
|
+
|
20
|
+
assert_equal "Deň víťazstva nad fašizmom", (Holidays.on(Date.civil(2013, 5, 8), [:sk], [:informal])[0] || {})[:name]
|
21
|
+
|
22
|
+
assert_equal "Sviatok svätého Cyrila a svätého Metoda", (Holidays.on(Date.civil(2013, 7, 5), [:sk], [:informal])[0] || {})[:name]
|
23
|
+
|
24
|
+
assert_equal "Výročie Slovenského národného povstania", (Holidays.on(Date.civil(2013, 8, 29), [:sk], [:informal])[0] || {})[:name]
|
25
|
+
|
26
|
+
assert_equal "Deň Ústavy Slovenskej republiky", (Holidays.on(Date.civil(2013, 9, 1), [:sk], [:informal])[0] || {})[:name]
|
27
|
+
|
28
|
+
assert_equal "Sedembolestná Panna Mária", (Holidays.on(Date.civil(2013, 9, 15), [:sk], [:informal])[0] || {})[:name]
|
29
|
+
|
30
|
+
assert_equal "Sviatok všetkých svätých", (Holidays.on(Date.civil(2013, 11, 1), [:sk], [:informal])[0] || {})[:name]
|
31
|
+
|
32
|
+
assert_equal "Deň boja za slobodu a demokraciu", (Holidays.on(Date.civil(2013, 11, 17), [:sk], [:informal])[0] || {})[:name]
|
33
|
+
|
34
|
+
assert_equal "Štedrý deň", (Holidays.on(Date.civil(2013, 12, 24), [:sk], [:informal])[0] || {})[:name]
|
35
|
+
|
36
|
+
assert_equal "1. sviatok vianočný", (Holidays.on(Date.civil(2013, 12, 25), [:sk], [:informal])[0] || {})[:name]
|
37
|
+
|
38
|
+
assert_equal "2. sviatok vianočný", (Holidays.on(Date.civil(2013, 12, 26), [:sk], [:informal])[0] || {})[:name]
|
27
39
|
|
28
40
|
end
|
29
41
|
end
|
data/test/defs/test_defs_tn.rb
CHANGED
@@ -7,16 +7,21 @@ require File.expand_path(File.dirname(__FILE__)) + '/../test_helper'
|
|
7
7
|
class TnDefinitionTests < Test::Unit::TestCase # :nodoc:
|
8
8
|
|
9
9
|
def test_tn
|
10
|
-
|
11
|
-
|
12
|
-
Date.civil(2016,
|
13
|
-
|
14
|
-
Date.civil(2016,
|
15
|
-
|
16
|
-
Date.civil(2016,
|
17
|
-
|
18
|
-
|
19
|
-
|
10
|
+
assert_equal "Jour de l'an", (Holidays.on(Date.civil(2016, 1, 1), [:tn])[0] || {})[:name]
|
11
|
+
|
12
|
+
assert_equal "Fête de la Révolution et de la Jeunesse", (Holidays.on(Date.civil(2016, 1, 14), [:tn])[0] || {})[:name]
|
13
|
+
|
14
|
+
assert_equal "Fête de l'Indépendance", (Holidays.on(Date.civil(2016, 3, 20), [:tn])[0] || {})[:name]
|
15
|
+
|
16
|
+
assert_equal "Journée des Martyrs", (Holidays.on(Date.civil(2016, 4, 9), [:tn])[0] || {})[:name]
|
17
|
+
|
18
|
+
assert_equal "Fête du travail", (Holidays.on(Date.civil(2016, 5, 1), [:tn])[0] || {})[:name]
|
19
|
+
|
20
|
+
assert_equal "Fête de la République", (Holidays.on(Date.civil(2016, 7, 25), [:tn])[0] || {})[:name]
|
21
|
+
|
22
|
+
assert_equal "Fête de la Femme et de la Famille", (Holidays.on(Date.civil(2016, 8, 13), [:tn])[0] || {})[:name]
|
23
|
+
|
24
|
+
assert_equal "Fête de l'Évacuation", (Holidays.on(Date.civil(2016, 10, 15), [:tn])[0] || {})[:name]
|
20
25
|
|
21
26
|
end
|
22
27
|
end
|
data/test/defs/test_defs_tr.rb
CHANGED
@@ -7,38 +7,47 @@ require File.expand_path(File.dirname(__FILE__)) + '/../test_helper'
|
|
7
7
|
class TrDefinitionTests < Test::Unit::TestCase # :nodoc:
|
8
8
|
|
9
9
|
def test_tr
|
10
|
-
|
11
|
-
Date.civil(2017, 4, 23) => 'Ulusal Egemenlik ve Çocuk Bayramı',
|
12
|
-
Date.civil(2017, 5, 1) => 'Emek ve Dayanışma Günü',
|
13
|
-
Date.civil(2017, 5, 19) => "Atatürk'ü Anma Gençlik ve Spor Bayramı",
|
14
|
-
Date.civil(2017, 8, 30) => 'Zafer Bayramı',
|
15
|
-
Date.civil(2017, 10, 29) => 'Cumhuriyet Bayramı'
|
16
|
-
}.each do |date, name|
|
17
|
-
assert_equal name, (Holidays.on(date, :tr)[0] || {})[:name]
|
18
|
-
end
|
10
|
+
assert_equal "Yılbaşı", (Holidays.on(Date.civil(2017, 1, 1), [:tr])[0] || {})[:name]
|
19
11
|
|
20
|
-
|
21
|
-
assert_equal 'Ramazan Bayramı', Holidays.on(date, :tr)[0][:name]
|
22
|
-
end
|
23
|
-
[Date.civil(2017, 6, 26), Date.civil(2018, 6, 16), Date.civil(2019, 6, 5)].each do |date|
|
24
|
-
assert_equal 'Ramazan Bayramı (ikinci tatil)', Holidays.on(date, :tr)[0][:name]
|
25
|
-
end
|
26
|
-
[Date.civil(2017, 6, 27), Date.civil(2018, 6, 17), Date.civil(2019, 6, 6)].each do |date|
|
27
|
-
assert_equal 'Ramazan Bayramı (üçüncü tatil)', Holidays.on(date, :tr)[0][:name]
|
28
|
-
end
|
12
|
+
assert_equal "Ulusal Egemenlik ve Çocuk Bayramı", (Holidays.on(Date.civil(2017, 4, 23), [:tr])[0] || {})[:name]
|
29
13
|
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
14
|
+
assert_equal "Emek ve Dayanışma Günü", (Holidays.on(Date.civil(2017, 5, 1), [:tr])[0] || {})[:name]
|
15
|
+
|
16
|
+
assert_equal "Atatürk'ü Anma Gençlik ve Spor Bayramı", (Holidays.on(Date.civil(2017, 5, 19), [:tr])[0] || {})[:name]
|
17
|
+
|
18
|
+
assert_equal "Zafer Bayramı", (Holidays.on(Date.civil(2017, 8, 30), [:tr])[0] || {})[:name]
|
19
|
+
|
20
|
+
assert_equal "Cumhuriyet Bayramı", (Holidays.on(Date.civil(2017, 10, 29), [:tr])[0] || {})[:name]
|
21
|
+
|
22
|
+
assert_equal "Ramazan Bayramı", (Holidays.on(Date.civil(2017, 6, 25), [:tr])[0] || {})[:name]
|
23
|
+
assert_equal "Ramazan Bayramı", (Holidays.on(Date.civil(2018, 6, 15), [:tr])[0] || {})[:name]
|
24
|
+
assert_equal "Ramazan Bayramı", (Holidays.on(Date.civil(2019, 6, 4), [:tr])[0] || {})[:name]
|
25
|
+
|
26
|
+
assert_equal "Ramazan Bayramı (ikinci tatil)", (Holidays.on(Date.civil(2017, 6, 26), [:tr])[0] || {})[:name]
|
27
|
+
assert_equal "Ramazan Bayramı (ikinci tatil)", (Holidays.on(Date.civil(2018, 6, 16), [:tr])[0] || {})[:name]
|
28
|
+
assert_equal "Ramazan Bayramı (ikinci tatil)", (Holidays.on(Date.civil(2019, 6, 5), [:tr])[0] || {})[:name]
|
29
|
+
|
30
|
+
assert_equal "Ramazan Bayramı (üçüncü tatil)", (Holidays.on(Date.civil(2017, 6, 27), [:tr])[0] || {})[:name]
|
31
|
+
assert_equal "Ramazan Bayramı (üçüncü tatil)", (Holidays.on(Date.civil(2018, 6, 17), [:tr])[0] || {})[:name]
|
32
|
+
assert_equal "Ramazan Bayramı (üçüncü tatil)", (Holidays.on(Date.civil(2019, 6, 6), [:tr])[0] || {})[:name]
|
33
|
+
|
34
|
+
assert_equal "Demokrasi ve Milli Birlik Günü", (Holidays.on(Date.civil(2017, 7, 15), [:tr])[0] || {})[:name]
|
35
|
+
|
36
|
+
assert_equal "Kurban Bayramı", (Holidays.on(Date.civil(2017, 9, 1), [:tr])[0] || {})[:name]
|
37
|
+
assert_equal "Kurban Bayramı", (Holidays.on(Date.civil(2018, 8, 21), [:tr])[0] || {})[:name]
|
38
|
+
assert_equal "Kurban Bayramı", (Holidays.on(Date.civil(2019, 8, 11), [:tr])[0] || {})[:name]
|
39
|
+
|
40
|
+
assert_equal "Kurban Bayramı (ikinci tatil)", (Holidays.on(Date.civil(2017, 9, 2), [:tr])[0] || {})[:name]
|
41
|
+
assert_equal "Kurban Bayramı (ikinci tatil)", (Holidays.on(Date.civil(2018, 8, 22), [:tr])[0] || {})[:name]
|
42
|
+
assert_equal "Kurban Bayramı (ikinci tatil)", (Holidays.on(Date.civil(2019, 8, 12), [:tr])[0] || {})[:name]
|
43
|
+
|
44
|
+
assert_equal "Kurban Bayramı (üçüncü tatil)", (Holidays.on(Date.civil(2017, 9, 3), [:tr])[0] || {})[:name]
|
45
|
+
assert_equal "Kurban Bayramı (üçüncü tatil)", (Holidays.on(Date.civil(2018, 8, 23), [:tr])[0] || {})[:name]
|
46
|
+
assert_equal "Kurban Bayramı (üçüncü tatil)", (Holidays.on(Date.civil(2019, 8, 13), [:tr])[0] || {})[:name]
|
47
|
+
|
48
|
+
assert_equal "Kurban Bayramı (dördüncü tatil)", (Holidays.on(Date.civil(2017, 9, 4), [:tr])[0] || {})[:name]
|
49
|
+
assert_equal "Kurban Bayramı (dördüncü tatil)", (Holidays.on(Date.civil(2018, 8, 24), [:tr])[0] || {})[:name]
|
50
|
+
assert_equal "Kurban Bayramı (dördüncü tatil)", (Holidays.on(Date.civil(2019, 8, 14), [:tr])[0] || {})[:name]
|
42
51
|
|
43
52
|
end
|
44
53
|
end
|
data/test/defs/test_defs_ups.rb
CHANGED
@@ -7,18 +7,25 @@ require File.expand_path(File.dirname(__FILE__)) + '/../test_helper'
|
|
7
7
|
class UpsDefinitionTests < Test::Unit::TestCase # :nodoc:
|
8
8
|
|
9
9
|
def test_ups
|
10
|
-
|
11
|
-
|
12
|
-
Date.civil(2008,
|
13
|
-
|
14
|
-
Date.civil(2008,
|
15
|
-
|
16
|
-
Date.civil(
|
17
|
-
|
18
|
-
Date.civil(2008,
|
19
|
-
|
20
|
-
|
21
|
-
|
10
|
+
assert_equal "New Year's Day", (Holidays.on(Date.civil(2008, 1, 1), [:ups])[0] || {})[:name]
|
11
|
+
|
12
|
+
assert_equal "Memorial Day", (Holidays.on(Date.civil(2008, 5, 26), [:ups])[0] || {})[:name]
|
13
|
+
|
14
|
+
assert_equal "Independence Day", (Holidays.on(Date.civil(2008, 7, 4), [:ups])[0] || {})[:name]
|
15
|
+
|
16
|
+
assert_equal "Labor Day", (Holidays.on(Date.civil(2008, 9, 1), [:ups])[0] || {})[:name]
|
17
|
+
|
18
|
+
assert_equal "Thanksgiving", (Holidays.on(Date.civil(2008, 11, 27), [:ups])[0] || {})[:name]
|
19
|
+
|
20
|
+
assert_equal "Day After Thanksgiving", (Holidays.on(Date.civil(2008, 11, 28), [:ups])[0] || {})[:name]
|
21
|
+
|
22
|
+
assert_equal "Thanksgiving", (Holidays.on(Date.civil(2013, 11, 28), [:ups])[0] || {})[:name]
|
23
|
+
|
24
|
+
assert_equal "Day After Thanksgiving", (Holidays.on(Date.civil(2013, 11, 29), [:ups])[0] || {})[:name]
|
25
|
+
|
26
|
+
assert_equal "Christmas Day", (Holidays.on(Date.civil(2008, 12, 25), [:ups])[0] || {})[:name]
|
27
|
+
|
28
|
+
assert_equal "New Year's Eve", (Holidays.on(Date.civil(2008, 12, 31), [:ups])[0] || {})[:name]
|
22
29
|
|
23
30
|
end
|
24
31
|
end
|