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
@@ -7,63 +7,105 @@ require File.expand_path(File.dirname(__FILE__)) + '/../test_helper'
|
|
7
7
|
class Federal_reserveDefinitionTests < Test::Unit::TestCase # :nodoc:
|
8
8
|
|
9
9
|
def test_federal_reserve
|
10
|
-
|
11
|
-
|
12
|
-
Date.civil(2012,
|
13
|
-
|
14
|
-
Date.civil(2012,
|
15
|
-
|
16
|
-
Date.civil(2012,
|
17
|
-
|
18
|
-
Date.civil(2012,
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
Date.civil(
|
23
|
-
|
24
|
-
Date.civil(
|
25
|
-
|
26
|
-
Date.civil(
|
27
|
-
|
28
|
-
Date.civil(
|
29
|
-
|
30
|
-
Date.civil(2013,
|
31
|
-
|
32
|
-
Date.civil(
|
33
|
-
|
34
|
-
Date.civil(
|
35
|
-
|
36
|
-
Date.civil(
|
37
|
-
|
38
|
-
Date.civil(
|
39
|
-
|
40
|
-
Date.civil(
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
Date.civil(
|
45
|
-
|
46
|
-
Date.civil(
|
47
|
-
|
48
|
-
Date.civil(
|
49
|
-
|
50
|
-
Date.civil(
|
51
|
-
|
52
|
-
Date.civil(
|
53
|
-
|
54
|
-
Date.civil(
|
55
|
-
|
56
|
-
Date.civil(
|
57
|
-
|
58
|
-
Date.civil(
|
59
|
-
|
60
|
-
Date.civil(
|
61
|
-
|
62
|
-
Date.civil(
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
10
|
+
assert_equal "New Year's Day", (Holidays.on(Date.civil(2012, 1, 2), [:federal_reserve], [:observed])[0] || {})[:name]
|
11
|
+
|
12
|
+
assert_equal "Birthday of Martin Luther King, Jr", (Holidays.on(Date.civil(2012, 1, 16), [:federal_reserve], [:observed])[0] || {})[:name]
|
13
|
+
|
14
|
+
assert_equal "Washington's Birthday", (Holidays.on(Date.civil(2012, 2, 20), [:federal_reserve], [:observed])[0] || {})[:name]
|
15
|
+
|
16
|
+
assert_equal "Memorial Day", (Holidays.on(Date.civil(2012, 5, 28), [:federal_reserve], [:observed])[0] || {})[:name]
|
17
|
+
|
18
|
+
assert_equal "Independence Day", (Holidays.on(Date.civil(2012, 7, 4), [:federal_reserve], [:observed])[0] || {})[:name]
|
19
|
+
|
20
|
+
assert_equal "Labor Day", (Holidays.on(Date.civil(2012, 9, 3), [:federal_reserve], [:observed])[0] || {})[:name]
|
21
|
+
|
22
|
+
assert_equal "Columbus Day", (Holidays.on(Date.civil(2012, 10, 8), [:federal_reserve], [:observed])[0] || {})[:name]
|
23
|
+
|
24
|
+
assert_equal "Veterans Day", (Holidays.on(Date.civil(2012, 11, 12), [:federal_reserve], [:observed])[0] || {})[:name]
|
25
|
+
|
26
|
+
assert_equal "Thanksgiving Day", (Holidays.on(Date.civil(2012, 11, 22), [:federal_reserve], [:observed])[0] || {})[:name]
|
27
|
+
|
28
|
+
assert_equal "Christmas Day", (Holidays.on(Date.civil(2012, 12, 25), [:federal_reserve], [:observed])[0] || {})[:name]
|
29
|
+
|
30
|
+
assert_equal "New Year's Day", (Holidays.on(Date.civil(2013, 1, 1), [:federal_reserve], [:observed])[0] || {})[:name]
|
31
|
+
|
32
|
+
assert_equal "Birthday of Martin Luther King, Jr", (Holidays.on(Date.civil(2013, 1, 21), [:federal_reserve], [:observed])[0] || {})[:name]
|
33
|
+
|
34
|
+
assert_equal "Washington's Birthday", (Holidays.on(Date.civil(2013, 2, 18), [:federal_reserve], [:observed])[0] || {})[:name]
|
35
|
+
|
36
|
+
assert_equal "Memorial Day", (Holidays.on(Date.civil(2013, 5, 27), [:federal_reserve], [:observed])[0] || {})[:name]
|
37
|
+
|
38
|
+
assert_equal "Independence Day", (Holidays.on(Date.civil(2013, 7, 4), [:federal_reserve], [:observed])[0] || {})[:name]
|
39
|
+
|
40
|
+
assert_equal "Labor Day", (Holidays.on(Date.civil(2013, 9, 2), [:federal_reserve], [:observed])[0] || {})[:name]
|
41
|
+
|
42
|
+
assert_equal "Columbus Day", (Holidays.on(Date.civil(2013, 10, 14), [:federal_reserve], [:observed])[0] || {})[:name]
|
43
|
+
|
44
|
+
assert_equal "Veterans Day", (Holidays.on(Date.civil(2013, 11, 11), [:federal_reserve], [:observed])[0] || {})[:name]
|
45
|
+
|
46
|
+
assert_equal "Thanksgiving Day", (Holidays.on(Date.civil(2013, 11, 28), [:federal_reserve], [:observed])[0] || {})[:name]
|
47
|
+
|
48
|
+
assert_equal "Christmas Day", (Holidays.on(Date.civil(2013, 12, 25), [:federal_reserve], [:observed])[0] || {})[:name]
|
49
|
+
|
50
|
+
assert_equal "New Year's Day", (Holidays.on(Date.civil(2014, 1, 1), [:federal_reserve], [:observed])[0] || {})[:name]
|
51
|
+
|
52
|
+
assert_equal "Birthday of Martin Luther King, Jr", (Holidays.on(Date.civil(2014, 1, 20), [:federal_reserve], [:observed])[0] || {})[:name]
|
53
|
+
|
54
|
+
assert_equal "Washington's Birthday", (Holidays.on(Date.civil(2014, 2, 17), [:federal_reserve], [:observed])[0] || {})[:name]
|
55
|
+
|
56
|
+
assert_equal "Memorial Day", (Holidays.on(Date.civil(2014, 5, 26), [:federal_reserve], [:observed])[0] || {})[:name]
|
57
|
+
|
58
|
+
assert_equal "Independence Day", (Holidays.on(Date.civil(2014, 7, 4), [:federal_reserve], [:observed])[0] || {})[:name]
|
59
|
+
|
60
|
+
assert_equal "Labor Day", (Holidays.on(Date.civil(2014, 9, 1), [:federal_reserve], [:observed])[0] || {})[:name]
|
61
|
+
|
62
|
+
assert_equal "Columbus Day", (Holidays.on(Date.civil(2014, 10, 13), [:federal_reserve], [:observed])[0] || {})[:name]
|
63
|
+
|
64
|
+
assert_equal "Veterans Day", (Holidays.on(Date.civil(2014, 11, 11), [:federal_reserve], [:observed])[0] || {})[:name]
|
65
|
+
|
66
|
+
assert_equal "Thanksgiving Day", (Holidays.on(Date.civil(2014, 11, 27), [:federal_reserve], [:observed])[0] || {})[:name]
|
67
|
+
|
68
|
+
assert_equal "Christmas Day", (Holidays.on(Date.civil(2014, 12, 25), [:federal_reserve], [:observed])[0] || {})[:name]
|
69
|
+
|
70
|
+
assert_equal "New Year's Day", (Holidays.on(Date.civil(2015, 1, 1), [:federal_reserve], [:observed])[0] || {})[:name]
|
71
|
+
|
72
|
+
assert_equal "Birthday of Martin Luther King, Jr", (Holidays.on(Date.civil(2015, 1, 19), [:federal_reserve], [:observed])[0] || {})[:name]
|
73
|
+
|
74
|
+
assert_equal "Washington's Birthday", (Holidays.on(Date.civil(2015, 2, 16), [:federal_reserve], [:observed])[0] || {})[:name]
|
75
|
+
|
76
|
+
assert_equal "Memorial Day", (Holidays.on(Date.civil(2015, 5, 25), [:federal_reserve], [:observed])[0] || {})[:name]
|
77
|
+
|
78
|
+
assert_equal "Independence Day", (Holidays.on(Date.civil(2015, 7, 4), [:federal_reserve], [:observed])[0] || {})[:name]
|
79
|
+
|
80
|
+
assert_equal "Labor Day", (Holidays.on(Date.civil(2015, 9, 7), [:federal_reserve], [:observed])[0] || {})[:name]
|
81
|
+
|
82
|
+
assert_equal "Columbus Day", (Holidays.on(Date.civil(2015, 10, 12), [:federal_reserve], [:observed])[0] || {})[:name]
|
83
|
+
|
84
|
+
assert_equal "Veterans Day", (Holidays.on(Date.civil(2015, 11, 11), [:federal_reserve], [:observed])[0] || {})[:name]
|
85
|
+
|
86
|
+
assert_equal "Thanksgiving Day", (Holidays.on(Date.civil(2015, 11, 26), [:federal_reserve], [:observed])[0] || {})[:name]
|
87
|
+
|
88
|
+
assert_equal "Christmas Day", (Holidays.on(Date.civil(2015, 12, 25), [:federal_reserve], [:observed])[0] || {})[:name]
|
89
|
+
|
90
|
+
assert_equal "New Year's Day", (Holidays.on(Date.civil(2016, 1, 1), [:federal_reserve], [:observed])[0] || {})[:name]
|
91
|
+
|
92
|
+
assert_equal "Birthday of Martin Luther King, Jr", (Holidays.on(Date.civil(2016, 1, 18), [:federal_reserve], [:observed])[0] || {})[:name]
|
93
|
+
|
94
|
+
assert_equal "Washington's Birthday", (Holidays.on(Date.civil(2016, 2, 15), [:federal_reserve], [:observed])[0] || {})[:name]
|
95
|
+
|
96
|
+
assert_equal "Memorial Day", (Holidays.on(Date.civil(2016, 5, 30), [:federal_reserve], [:observed])[0] || {})[:name]
|
97
|
+
|
98
|
+
assert_equal "Independence Day", (Holidays.on(Date.civil(2016, 7, 4), [:federal_reserve], [:observed])[0] || {})[:name]
|
99
|
+
|
100
|
+
assert_equal "Labor Day", (Holidays.on(Date.civil(2016, 9, 5), [:federal_reserve], [:observed])[0] || {})[:name]
|
101
|
+
|
102
|
+
assert_equal "Columbus Day", (Holidays.on(Date.civil(2016, 10, 10), [:federal_reserve], [:observed])[0] || {})[:name]
|
103
|
+
|
104
|
+
assert_equal "Veterans Day", (Holidays.on(Date.civil(2016, 11, 11), [:federal_reserve], [:observed])[0] || {})[:name]
|
105
|
+
|
106
|
+
assert_equal "Thanksgiving Day", (Holidays.on(Date.civil(2016, 11, 24), [:federal_reserve], [:observed])[0] || {})[:name]
|
107
|
+
|
108
|
+
assert_equal "Christmas Day", (Holidays.on(Date.civil(2016, 12, 26), [:federal_reserve], [:observed])[0] || {})[:name]
|
67
109
|
|
68
110
|
end
|
69
111
|
end
|
@@ -7,18 +7,25 @@ require File.expand_path(File.dirname(__FILE__)) + '/../test_helper'
|
|
7
7
|
class FedexDefinitionTests < Test::Unit::TestCase # :nodoc:
|
8
8
|
|
9
9
|
def test_fedex
|
10
|
-
|
11
|
-
|
12
|
-
Date.civil(2015,
|
13
|
-
|
14
|
-
Date.civil(2015,
|
15
|
-
|
16
|
-
Date.civil(
|
17
|
-
|
18
|
-
Date.civil(2015,
|
19
|
-
|
20
|
-
|
21
|
-
|
10
|
+
assert_equal "New Year's Day", (Holidays.on(Date.civil(2015, 1, 1), [:ups])[0] || {})[:name]
|
11
|
+
|
12
|
+
assert_equal "Memorial Day", (Holidays.on(Date.civil(2015, 5, 25), [:ups])[0] || {})[:name]
|
13
|
+
|
14
|
+
assert_equal "Independence Day", (Holidays.on(Date.civil(2015, 7, 4), [:ups])[0] || {})[:name]
|
15
|
+
|
16
|
+
assert_equal "Labor Day", (Holidays.on(Date.civil(2015, 9, 7), [:ups])[0] || {})[:name]
|
17
|
+
|
18
|
+
assert_equal "Thanksgiving", (Holidays.on(Date.civil(2015, 11, 26), [:ups])[0] || {})[:name]
|
19
|
+
|
20
|
+
assert_equal "Day After Thanksgiving", (Holidays.on(Date.civil(2015, 11, 27), [: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(2015, 12, 25), [:ups])[0] || {})[:name]
|
27
|
+
|
28
|
+
assert_equal "New Year's Eve", (Holidays.on(Date.civil(2015, 12, 31), [:ups])[0] || {})[:name]
|
22
29
|
|
23
30
|
end
|
24
31
|
end
|
data/test/defs/test_defs_fi.rb
CHANGED
@@ -7,33 +7,53 @@ require File.expand_path(File.dirname(__FILE__)) + '/../test_helper'
|
|
7
7
|
class FiDefinitionTests < Test::Unit::TestCase # :nodoc:
|
8
8
|
|
9
9
|
def test_fi
|
10
|
-
|
11
|
-
|
12
|
-
Date.civil(2008,
|
13
|
-
|
14
|
-
Date.civil(2008,3,
|
15
|
-
|
16
|
-
Date.civil(2008,
|
17
|
-
|
18
|
-
Date.civil(
|
19
|
-
|
20
|
-
Date.civil(
|
21
|
-
|
22
|
-
Date.civil(
|
23
|
-
|
24
|
-
Date.civil(
|
25
|
-
|
26
|
-
Date.civil(
|
27
|
-
|
28
|
-
Date.civil(
|
29
|
-
|
30
|
-
Date.civil(
|
31
|
-
|
32
|
-
Date.civil(
|
33
|
-
|
34
|
-
Date.civil(
|
35
|
-
|
36
|
-
|
10
|
+
assert_equal "Uudenvuodenpäivä", (Holidays.on(Date.civil(2008, 1, 1), [:fi], [:informal])[0] || {})[:name]
|
11
|
+
|
12
|
+
assert_equal "Loppiainen", (Holidays.on(Date.civil(2008, 1, 6), [:fi], [:informal])[0] || {})[:name]
|
13
|
+
|
14
|
+
assert_equal "Pitkäperjantai", (Holidays.on(Date.civil(2008, 3, 21), [:fi], [:informal])[0] || {})[:name]
|
15
|
+
|
16
|
+
assert_equal "Pääsiäispäivä", (Holidays.on(Date.civil(2008, 3, 23), [:fi], [:informal])[0] || {})[:name]
|
17
|
+
|
18
|
+
assert_equal "2. Pääsiäispäivä", (Holidays.on(Date.civil(2008, 3, 24), [:fi], [:informal])[0] || {})[:name]
|
19
|
+
|
20
|
+
assert_equal "Helatorstai", (Holidays.on(Date.civil(2008, 5, 1), [:fi], [:informal])[0] || {})[:name]
|
21
|
+
|
22
|
+
assert_equal "Helluntaipäivä", (Holidays.on(Date.civil(2008, 5, 11), [:fi], [:informal])[0] || {})[:name]
|
23
|
+
|
24
|
+
assert_equal "Juhannusaatto", (Holidays.on(Date.civil(2009, 6, 19), [:fi], [:informal])[0] || {})[:name]
|
25
|
+
|
26
|
+
assert_equal "Juhannusaatto", (Holidays.on(Date.civil(2010, 6, 25), [:fi], [:informal])[0] || {})[:name]
|
27
|
+
|
28
|
+
assert_equal "Juhannusaatto", (Holidays.on(Date.civil(2011, 6, 24), [:fi], [:informal])[0] || {})[:name]
|
29
|
+
|
30
|
+
assert_equal "Juhannusaatto", (Holidays.on(Date.civil(2012, 6, 22), [:fi], [:informal])[0] || {})[:name]
|
31
|
+
|
32
|
+
assert_equal "Juhannusaatto", (Holidays.on(Date.civil(2013, 6, 21), [:fi], [:informal])[0] || {})[:name]
|
33
|
+
|
34
|
+
assert_equal "Juhannuspäivä", (Holidays.on(Date.civil(2005, 6, 25), [:fi], [:informal])[0] || {})[:name]
|
35
|
+
|
36
|
+
assert_equal "Juhannuspäivä", (Holidays.on(Date.civil(2006, 6, 24), [:fi], [:informal])[0] || {})[:name]
|
37
|
+
|
38
|
+
assert_equal "Juhannuspäivä", (Holidays.on(Date.civil(2007, 6, 23), [:fi], [:informal])[0] || {})[:name]
|
39
|
+
|
40
|
+
assert_equal "Juhannuspäivä", (Holidays.on(Date.civil(2008, 6, 21), [:fi], [:informal])[0] || {})[:name]
|
41
|
+
|
42
|
+
assert_equal "Pyhäinpäivä", (Holidays.on(Date.civil(2005, 11, 5), [:fi], [:informal])[0] || {})[:name]
|
43
|
+
|
44
|
+
assert_equal "Pyhäinpäivä", (Holidays.on(Date.civil(2006, 11, 4), [:fi], [:informal])[0] || {})[:name]
|
45
|
+
|
46
|
+
assert_equal "Pyhäinpäivä", (Holidays.on(Date.civil(2007, 11, 3), [:fi], [:informal])[0] || {})[:name]
|
47
|
+
|
48
|
+
assert_equal "Pyhäinpäivä", (Holidays.on(Date.civil(2008, 11, 1), [:fi], [:informal])[0] || {})[:name]
|
49
|
+
|
50
|
+
assert_equal "Itsenäisyyspäivä", (Holidays.on(Date.civil(2008, 12, 6), [:fi], [:informal])[0] || {})[:name]
|
51
|
+
|
52
|
+
assert_equal "Jouluaatto", (Holidays.on(Date.civil(2008, 12, 24), [:fi], [:informal])[0] || {})[:name]
|
53
|
+
|
54
|
+
assert_equal "Joulupäivä", (Holidays.on(Date.civil(2008, 12, 25), [:fi], [:informal])[0] || {})[:name]
|
55
|
+
|
56
|
+
assert_equal "Tapaninpäivä", (Holidays.on(Date.civil(2008, 12, 26), [:fi], [:informal])[0] || {})[:name]
|
37
57
|
|
38
58
|
end
|
39
59
|
end
|
data/test/defs/test_defs_fr.rb
CHANGED
@@ -7,32 +7,37 @@ require File.expand_path(File.dirname(__FILE__)) + '/../test_helper'
|
|
7
7
|
class FrDefinitionTests < Test::Unit::TestCase # :nodoc:
|
8
8
|
|
9
9
|
def test_fr
|
10
|
-
|
11
|
-
Date.civil(2007, 4, 9) => 'Lundi de Pâques',
|
12
|
-
Date.civil(2007, 5, 1) => 'Fête du travail',
|
13
|
-
Date.civil(2007, 5, 8) => 'Victoire 1945',
|
14
|
-
Date.civil(2007, 5, 17) => 'Ascension',
|
15
|
-
Date.civil(2007, 5, 28) => 'Lundi de Pentecôte',
|
16
|
-
Date.civil(2007, 7, 14) => 'Fête nationale',
|
17
|
-
Date.civil(2007, 8, 15) => 'Assomption',
|
18
|
-
Date.civil(2007, 11, 1) => 'Toussaint',
|
19
|
-
Date.civil(2007, 11, 11) => 'Armistice 1918',
|
20
|
-
Date.civil(2007, 12, 25) => 'Noël' }.each do |date, name|
|
21
|
-
assert_equal name, (Holidays.on(date, :fr)[0] || {})[:name]
|
22
|
-
end
|
23
|
-
{ Date.civil(2007, 4, 8) => 'Pâques',
|
24
|
-
Date.civil(2007, 5, 27) => 'Pentecôte' }.each do |date, name|
|
25
|
-
assert_nil (Holidays.on(date, :fr)[0] || {})[:name]
|
26
|
-
assert_equal name, (Holidays.on(date, :fr, :informal)[0] || {})[:name]
|
27
|
-
end
|
10
|
+
assert_equal "Jour de l'an", (Holidays.on(Date.civil(2007, 1, 1), [:fr])[0] || {})[:name]
|
28
11
|
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
12
|
+
assert_equal "Lundi de Pâques", (Holidays.on(Date.civil(2007, 4, 9), [:fr])[0] || {})[:name]
|
13
|
+
|
14
|
+
assert_equal "Fête du travail", (Holidays.on(Date.civil(2007, 5, 1), [:fr])[0] || {})[:name]
|
15
|
+
|
16
|
+
assert_equal "Victoire 1945", (Holidays.on(Date.civil(2007, 5, 8), [:fr])[0] || {})[:name]
|
17
|
+
|
18
|
+
assert_equal "Ascension", (Holidays.on(Date.civil(2007, 5, 17), [:fr])[0] || {})[:name]
|
19
|
+
|
20
|
+
assert_equal "Lundi de Pentecôte", (Holidays.on(Date.civil(2007, 5, 28), [:fr])[0] || {})[:name]
|
21
|
+
|
22
|
+
assert_equal "Fête nationale", (Holidays.on(Date.civil(2007, 7, 14), [:fr])[0] || {})[:name]
|
23
|
+
|
24
|
+
assert_equal "Assomption", (Holidays.on(Date.civil(2007, 8, 15), [:fr])[0] || {})[:name]
|
25
|
+
|
26
|
+
assert_equal "Toussaint", (Holidays.on(Date.civil(2007, 11, 1), [:fr])[0] || {})[:name]
|
27
|
+
|
28
|
+
assert_equal "Armistice 1918", (Holidays.on(Date.civil(2007, 11, 11), [:fr])[0] || {})[:name]
|
29
|
+
|
30
|
+
assert_equal "Noël", (Holidays.on(Date.civil(2007, 12, 25), [:fr])[0] || {})[:name]
|
31
|
+
|
32
|
+
assert_nil (Holidays.on(Date.civil(2007, 4, 8), [:fr])[0] || {})[:name]
|
33
|
+
|
34
|
+
assert_nil (Holidays.on(Date.civil(2007, 5, 27), [:fr])[0] || {})[:name]
|
35
|
+
|
36
|
+
assert_equal "Pâques", (Holidays.on(Date.civil(2007, 4, 8), [:fr], [:informal])[0] || {})[:name]
|
37
|
+
|
38
|
+
assert_equal "Pentecôte", (Holidays.on(Date.civil(2007, 5, 27), [:fr], [:informal])[0] || {})[:name]
|
33
39
|
|
34
|
-
|
35
|
-
assert_equal 'Saint-Étienne', Holidays.on(Date.civil(2017, 12, 26), [:fr_a, :fr_m])[0][:name]
|
40
|
+
assert_equal "Saint-Étienne", (Holidays.on(Date.civil(2017, 12, 26), [:fr_a, :fr_m], [:informal])[0] || {})[:name]
|
36
41
|
|
37
42
|
end
|
38
43
|
end
|
data/test/defs/test_defs_gb.rb
CHANGED
@@ -7,58 +7,97 @@ require File.expand_path(File.dirname(__FILE__)) + '/../test_helper'
|
|
7
7
|
class GbDefinitionTests < Test::Unit::TestCase # :nodoc:
|
8
8
|
|
9
9
|
def test_gb
|
10
|
-
|
11
|
-
Date.civil(2008,3,23) => 'Easter Sunday',
|
12
|
-
Date.civil(2008,5,5) => 'May Day',
|
13
|
-
Date.civil(2008,5,26) => 'Bank Holiday',
|
14
|
-
Date.civil(2008,11,5) => 'Guy Fawkes Day',
|
15
|
-
Date.civil(2008,12,25) => 'Christmas Day',
|
16
|
-
Date.civil(2008,12,26) => 'Boxing Day'}.each do |date, name|
|
17
|
-
assert_equal name, (Holidays.on(date, :gb, :informal)[0] || {})[:name]
|
18
|
-
end
|
10
|
+
assert_equal "Good Friday", (Holidays.on(Date.civil(2008, 3, 21), [:gb], [:informal])[0] || {})[:name]
|
19
11
|
|
20
|
-
assert_equal
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
assert_equal
|
25
|
-
|
26
|
-
assert_equal
|
27
|
-
|
28
|
-
assert_equal
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
assert_equal
|
33
|
-
|
34
|
-
assert_equal
|
35
|
-
|
36
|
-
assert_equal
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
assert_equal '
|
47
|
-
|
48
|
-
assert_equal
|
49
|
-
|
50
|
-
assert_equal
|
51
|
-
|
52
|
-
assert_equal '
|
53
|
-
|
54
|
-
assert_equal '
|
55
|
-
|
56
|
-
assert_equal '
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
12
|
+
assert_equal "Easter Sunday", (Holidays.on(Date.civil(2008, 3, 23), [:gb], [:informal])[0] || {})[:name]
|
13
|
+
|
14
|
+
assert_equal "May Day", (Holidays.on(Date.civil(2008, 5, 5), [:gb], [:informal])[0] || {})[:name]
|
15
|
+
|
16
|
+
assert_equal "Bank Holiday", (Holidays.on(Date.civil(2008, 5, 26), [:gb], [:informal])[0] || {})[:name]
|
17
|
+
|
18
|
+
assert_equal "Guy Fawkes Day", (Holidays.on(Date.civil(2008, 11, 5), [:gb], [:informal])[0] || {})[:name]
|
19
|
+
|
20
|
+
assert_equal "Christmas Day", (Holidays.on(Date.civil(2008, 12, 25), [:gb], [:informal])[0] || {})[:name]
|
21
|
+
|
22
|
+
assert_equal "Boxing Day", (Holidays.on(Date.civil(2008, 12, 26), [:gb], [:informal])[0] || {})[:name]
|
23
|
+
|
24
|
+
assert_equal "St. Patrick's Day", (Holidays.on(Date.civil(2008, 3, 17), [:gb_nir], [:informal])[0] || {})[:name]
|
25
|
+
|
26
|
+
assert_equal "St. Andrew's Day", (Holidays.on(Date.civil(2006, 11, 30), [:gb_sct], [:informal])[0] || {})[:name]
|
27
|
+
|
28
|
+
assert_equal "St. Andrew's Day", (Holidays.on(Date.civil(2006, 11, 30), [:gb_sct], [:informal, :observed])[0] || {})[:name]
|
29
|
+
|
30
|
+
assert_equal "St. Andrew's Day", (Holidays.on(Date.civil(2002, 12, 2), [:gb_sct], [:informal, :observed])[0] || {})[:name]
|
31
|
+
|
32
|
+
assert_nil (Holidays.on(Date.civil(2004, 11, 30), [:gb_sct])[0] || {})[:name]
|
33
|
+
|
34
|
+
assert_nil (Holidays.on(Date.civil(2005, 11, 30), [:gb_sct])[0] || {})[:name]
|
35
|
+
|
36
|
+
assert_nil (Holidays.on(Date.civil(2006, 11, 30), [:gb_sct])[0] || {})[:name]
|
37
|
+
|
38
|
+
assert_equal "St. Andrew's Day", (Holidays.on(Date.civil(2007, 11, 30), [:gb_sct])[0] || {})[:name]
|
39
|
+
|
40
|
+
assert_equal "St. Andrew's Day", (Holidays.on(Date.civil(2007, 11, 30), [:gb_sct], [:informal])[0] || {})[:name]
|
41
|
+
|
42
|
+
assert_equal "St. Andrew's Day", (Holidays.on(Date.civil(2007, 11, 30), [:gb_sct], [:informal, :observed])[0] || {})[:name]
|
43
|
+
|
44
|
+
assert_equal "St. Andrew's Day", (Holidays.on(Date.civil(2016, 11, 30), [:gb_sct])[0] || {})[:name]
|
45
|
+
|
46
|
+
assert_equal "St. Andrew's Day", (Holidays.on(Date.civil(2019, 11, 30), [:gb_sct])[0] || {})[:name]
|
47
|
+
|
48
|
+
assert_equal "St. Andrew's Day", (Holidays.on(Date.civil(2019, 11, 30), [:gb_sct])[0] || {})[:name]
|
49
|
+
|
50
|
+
assert_equal "St. Andrew's Day", (Holidays.on(Date.civil(2019, 12, 2), [:gb_sct], [:observed])[0] || {})[:name]
|
51
|
+
|
52
|
+
assert_equal "Christmas Day", (Holidays.on(Date.civil(2008, 12, 25), [:gb_], [:observed])[0] || {})[:name]
|
53
|
+
|
54
|
+
assert_equal "Christmas Day", (Holidays.on(Date.civil(2009, 12, 25), [:gb_], [:observed])[0] || {})[:name]
|
55
|
+
|
56
|
+
assert_equal "Christmas Day", (Holidays.on(Date.civil(2010, 12, 27), [:gb_], [:observed])[0] || {})[:name]
|
57
|
+
|
58
|
+
assert_equal "Boxing Day", (Holidays.on(Date.civil(2008, 12, 26), [:gb_], [:observed])[0] || {})[:name]
|
59
|
+
|
60
|
+
assert_equal "Boxing Day", (Holidays.on(Date.civil(2009, 12, 28), [:gb_], [:observed])[0] || {})[:name]
|
61
|
+
|
62
|
+
assert_equal "Boxing Day", (Holidays.on(Date.civil(2010, 12, 28), [:gb_], [:observed])[0] || {})[:name]
|
63
|
+
|
64
|
+
assert_equal "Boxing Day", (Holidays.on(Date.civil(2011, 12, 27), [:gb_], [:observed])[0] || {})[:name]
|
65
|
+
|
66
|
+
assert_equal "New Year's Day", (Holidays.on(Date.civil(2010, 1, 1), [:gb], [:observed])[0] || {})[:name]
|
67
|
+
|
68
|
+
assert_equal "New Year's Day", (Holidays.on(Date.civil(2011, 1, 3), [:gb], [:observed])[0] || {})[:name]
|
69
|
+
|
70
|
+
assert_equal "New Year's Day", (Holidays.on(Date.civil(2012, 1, 2), [:gb], [:observed])[0] || {})[:name]
|
71
|
+
|
72
|
+
assert_equal "2nd January", (Holidays.on(Date.civil(2010, 1, 4), [:gb_sct], [:observed])[0] || {})[:name]
|
73
|
+
|
74
|
+
assert_equal "2nd January", (Holidays.on(Date.civil(2011, 1, 4), [:gb_sct], [:observed])[0] || {})[:name]
|
75
|
+
|
76
|
+
assert_equal "2nd January", (Holidays.on(Date.civil(2012, 1, 3), [:gb_sct], [:observed])[0] || {})[:name]
|
77
|
+
|
78
|
+
assert_equal "2nd January", (Holidays.on(Date.civil(2013, 1, 2), [:gb_sct], [:observed])[0] || {})[:name]
|
79
|
+
|
80
|
+
assert_equal "2nd January", (Holidays.on(Date.civil(2014, 1, 2), [:gb_sct], [:observed])[0] || {})[:name]
|
81
|
+
|
82
|
+
assert_equal "Easter Monday", (Holidays.on(Date.civil(2008, 3, 24), [:gb_wls])[0] || {})[:name]
|
83
|
+
|
84
|
+
assert_equal "Bank Holiday", (Holidays.on(Date.civil(2008, 8, 25), [:gb_wls])[0] || {})[:name]
|
85
|
+
|
86
|
+
assert_equal "Easter Monday", (Holidays.on(Date.civil(2008, 3, 24), [:gb_eng])[0] || {})[:name]
|
87
|
+
|
88
|
+
assert_equal "Bank Holiday", (Holidays.on(Date.civil(2008, 8, 25), [:gb_eng])[0] || {})[:name]
|
89
|
+
|
90
|
+
assert_equal "Easter Monday", (Holidays.on(Date.civil(2008, 3, 24), [:gb_nir])[0] || {})[:name]
|
91
|
+
|
92
|
+
assert_equal "Bank Holiday", (Holidays.on(Date.civil(2008, 8, 25), [:gb_nir])[0] || {})[:name]
|
93
|
+
|
94
|
+
assert_equal "Easter Monday", (Holidays.on(Date.civil(2008, 3, 24), [:gb_eaw])[0] || {})[:name]
|
95
|
+
|
96
|
+
assert_equal "Bank Holiday", (Holidays.on(Date.civil(2008, 8, 25), [:gb_eaw])[0] || {})[:name]
|
97
|
+
|
98
|
+
assert_equal "Easter Monday", (Holidays.on(Date.civil(2008, 3, 24), [:gb_])[0] || {})[:name]
|
99
|
+
|
100
|
+
assert_equal "Bank Holiday", (Holidays.on(Date.civil(2008, 8, 25), [:gb_])[0] || {})[:name]
|
62
101
|
|
63
102
|
end
|
64
103
|
end
|