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/lib/holidays/version.rb
CHANGED
data/test/coverage_report.rb
CHANGED
@@ -3,7 +3,10 @@ months:
|
|
3
3
|
- name: Company Founding!
|
4
4
|
regions: [custom_multiple_files]
|
5
5
|
mday: 5
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
6
|
+
|
7
|
+
tests:
|
8
|
+
- given:
|
9
|
+
date: "2013-10-5"
|
10
|
+
regions: ["custom_multiple_files"]
|
11
|
+
expect:
|
12
|
+
name: "Company Founding!"
|
@@ -3,7 +3,10 @@ months:
|
|
3
3
|
- name: Company Founding
|
4
4
|
regions: [custom_single_file]
|
5
5
|
mday: 20
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
6
|
+
|
7
|
+
tests:
|
8
|
+
- given:
|
9
|
+
date: '2013-06-20'
|
10
|
+
regions: [custom_single_file]
|
11
|
+
expect:
|
12
|
+
name: "Company Founding"
|
@@ -14,11 +14,15 @@ methods:
|
|
14
14
|
source: |
|
15
15
|
d = Date.civil(year, month, 1)
|
16
16
|
d + 2
|
17
|
-
tests: |
|
18
|
-
{Date.civil(2013,6,20) => 'Company Founding'}.each do |date, name|
|
19
|
-
assert_equal name, (Holidays.on(date, :custom_single_file)[0] || {})[:name]
|
20
|
-
end
|
21
17
|
|
22
|
-
|
23
|
-
|
24
|
-
|
18
|
+
tests:
|
19
|
+
- given:
|
20
|
+
date: '2013-06-20'
|
21
|
+
regions: [custom_single_file]
|
22
|
+
expect:
|
23
|
+
name: "Company Founding"
|
24
|
+
- given:
|
25
|
+
date: '2015-01-01'
|
26
|
+
regions: [custom_single_file]
|
27
|
+
expect:
|
28
|
+
name: "Custom Holiday"
|
data/test/defs/test_defs_ar.rb
CHANGED
@@ -7,25 +7,39 @@ require File.expand_path(File.dirname(__FILE__)) + '/../test_helper'
|
|
7
7
|
class ArDefinitionTests < Test::Unit::TestCase # :nodoc:
|
8
8
|
|
9
9
|
def test_ar
|
10
|
-
|
11
|
-
|
12
|
-
Date.civil(2016,2,
|
13
|
-
|
14
|
-
Date.civil(2016,
|
15
|
-
|
16
|
-
Date.civil(2016,
|
17
|
-
|
18
|
-
Date.civil(2016,
|
19
|
-
|
20
|
-
Date.civil(2016,
|
21
|
-
|
22
|
-
Date.civil(2016,
|
23
|
-
|
24
|
-
Date.civil(2016,
|
25
|
-
|
26
|
-
Date.civil(2016,
|
27
|
-
|
28
|
-
|
10
|
+
assert_equal "Año Nuevo", (Holidays.on(Date.civil(2016, 1, 1), [:ar], [:informal])[0] || {})[:name]
|
11
|
+
|
12
|
+
assert_equal "Carnaval", (Holidays.on(Date.civil(2016, 2, 8), [:ar], [:informal])[0] || {})[:name]
|
13
|
+
|
14
|
+
assert_equal "Carnaval", (Holidays.on(Date.civil(2016, 2, 9), [:ar], [:informal])[0] || {})[:name]
|
15
|
+
|
16
|
+
assert_equal "Día Nacional de la Memoria por la Verdad y la Justicia", (Holidays.on(Date.civil(2016, 3, 24), [:ar], [:informal])[0] || {})[:name]
|
17
|
+
|
18
|
+
assert_equal "Viernes Santo", (Holidays.on(Date.civil(2016, 3, 25), [:ar], [:informal])[0] || {})[:name]
|
19
|
+
|
20
|
+
assert_equal "Día del Veterano y de los Caídos en la Guerra de Malvinas", (Holidays.on(Date.civil(2016, 4, 2), [:ar], [:informal])[0] || {})[:name]
|
21
|
+
|
22
|
+
assert_equal "Día del Trabajador", (Holidays.on(Date.civil(2016, 5, 1), [:ar], [:informal])[0] || {})[:name]
|
23
|
+
|
24
|
+
assert_equal "Día de la Revolución de Mayo", (Holidays.on(Date.civil(2016, 5, 25), [:ar], [:informal])[0] || {})[:name]
|
25
|
+
|
26
|
+
assert_equal "Día de la Bandera", (Holidays.on(Date.civil(2016, 6, 20), [:ar], [:informal])[0] || {})[:name]
|
27
|
+
|
28
|
+
assert_equal "Feriado puente turístico", (Holidays.on(Date.civil(2016, 7, 8), [:ar], [:informal])[0] || {})[:name]
|
29
|
+
|
30
|
+
assert_equal "Día de la Independencia", (Holidays.on(Date.civil(2016, 7, 9), [:ar], [:informal])[0] || {})[:name]
|
31
|
+
|
32
|
+
assert_equal "Paso a la Inmortalidad del General José de San Martín", (Holidays.on(Date.civil(2016, 8, 15), [:ar], [:informal])[0] || {})[:name]
|
33
|
+
|
34
|
+
assert_equal "Día del Respeto a la Diversidad Cultural", (Holidays.on(Date.civil(2016, 10, 12), [:ar], [:informal])[0] || {})[:name]
|
35
|
+
|
36
|
+
assert_equal "Día de la Soberanía Nacional", (Holidays.on(Date.civil(2016, 11, 20), [:ar], [:informal])[0] || {})[:name]
|
37
|
+
|
38
|
+
assert_equal "Inmaculada Concepción de María", (Holidays.on(Date.civil(2016, 12, 8), [:ar], [:informal])[0] || {})[:name]
|
39
|
+
|
40
|
+
assert_equal "Feriado puente turístico", (Holidays.on(Date.civil(2016, 12, 9), [:ar], [:informal])[0] || {})[:name]
|
41
|
+
|
42
|
+
assert_equal "Navidad", (Holidays.on(Date.civil(2016, 12, 25), [:ar], [:informal])[0] || {})[:name]
|
29
43
|
|
30
44
|
end
|
31
45
|
end
|
data/test/defs/test_defs_at.rb
CHANGED
@@ -7,18 +7,21 @@ require File.expand_path(File.dirname(__FILE__)) + '/../test_helper'
|
|
7
7
|
class AtDefinitionTests < Test::Unit::TestCase # :nodoc:
|
8
8
|
|
9
9
|
def test_at
|
10
|
-
|
11
|
-
|
12
|
-
Date.civil(2009,
|
13
|
-
|
14
|
-
Date.civil(2009,
|
15
|
-
|
16
|
-
Date.civil(2009,
|
17
|
-
|
18
|
-
|
19
|
-
|
10
|
+
assert_equal "Neujahrstag", (Holidays.on(Date.civil(2009, 1, 1), [:at], [:informal])[0] || {})[:name]
|
11
|
+
|
12
|
+
assert_equal "Ostermontag", (Holidays.on(Date.civil(2009, 4, 13), [:at], [:informal])[0] || {})[:name]
|
13
|
+
|
14
|
+
assert_equal "Christi Himmelfahrt", (Holidays.on(Date.civil(2009, 5, 21), [:at], [:informal])[0] || {})[:name]
|
15
|
+
|
16
|
+
assert_equal "Pfingstmontag", (Holidays.on(Date.civil(2009, 6, 1), [:at], [:informal])[0] || {})[:name]
|
17
|
+
|
18
|
+
assert_equal "Nationalfeiertag", (Holidays.on(Date.civil(2009, 10, 26), [:at], [:informal])[0] || {})[:name]
|
19
|
+
|
20
|
+
assert_equal "1. Weihnachtstag", (Holidays.on(Date.civil(2009, 12, 25), [:at], [:informal])[0] || {})[:name]
|
21
|
+
|
22
|
+
assert_equal "2. Weihnachtstag", (Holidays.on(Date.civil(2009, 12, 26), [:at], [:informal])[0] || {})[:name]
|
20
23
|
|
21
|
-
|
24
|
+
assert_nil (Holidays.on(Date.civil(2010, 5, 8), [:at])[0] || {})[:name]
|
22
25
|
|
23
26
|
end
|
24
27
|
end
|
data/test/defs/test_defs_au.rb
CHANGED
@@ -7,152 +7,183 @@ require File.expand_path(File.dirname(__FILE__)) + '/../test_helper'
|
|
7
7
|
class AuDefinitionTests < Test::Unit::TestCase # :nodoc:
|
8
8
|
|
9
9
|
def test_au
|
10
|
-
|
11
|
-
Date.civil(2007,1,26) => 'Australia Day',
|
12
|
-
Date.civil(2007,4,6) => 'Good Friday',
|
13
|
-
Date.civil(2007,4,9) => 'Easter Monday',
|
14
|
-
Date.civil(2007,4,25) => 'ANZAC Day'}.each do |date, name|
|
15
|
-
assert_equal name, (Holidays.on(date, :au, :informal)[0] || {})[:name]
|
16
|
-
end
|
10
|
+
assert_equal "Labour Day", (Holidays.on(Date.civil(2013, 10, 7), [:au_qld])[0] || {})[:name]
|
17
11
|
|
18
|
-
|
19
|
-
assert_equal 'Labour Day', Holidays.on(Date.civil(2007,10,1), r)[0][:name]
|
20
|
-
end
|
12
|
+
assert_equal "Labour Day", (Holidays.on(Date.civil(2012, 5, 7), [:au_qld])[0] || {})[:name]
|
21
13
|
|
22
|
-
|
23
|
-
assert_equal 'Queen\'s Birthday', Holidays.on(Date.civil(2007,6,11), r)[0][:name]
|
24
|
-
end
|
14
|
+
assert_equal "Labour Day", (Holidays.on(Date.civil(2015, 10, 5), [:au_qld])[0] || {})[:name]
|
25
15
|
|
26
|
-
assert_equal
|
27
|
-
|
28
|
-
assert_equal '
|
29
|
-
|
30
|
-
assert_equal '
|
31
|
-
|
32
|
-
assert_equal '
|
33
|
-
|
34
|
-
assert_equal '
|
35
|
-
|
36
|
-
assert_equal '
|
37
|
-
|
38
|
-
assert_equal
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
assert_equal "
|
43
|
-
|
44
|
-
assert_equal "
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
assert_equal "
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
assert_equal "
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
assert_equal
|
57
|
-
|
58
|
-
assert_equal
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
assert_equal
|
63
|
-
|
64
|
-
assert_equal
|
65
|
-
|
66
|
-
assert_equal
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
assert_nil Date.civil(2015,
|
73
|
-
|
74
|
-
assert_equal
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
assert_equal
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
assert_equal "
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
assert_equal
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
assert_equal
|
113
|
-
|
114
|
-
assert_equal
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
assert_equal "
|
119
|
-
|
120
|
-
assert_equal "
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
assert_equal "
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
assert_equal "
|
135
|
-
|
136
|
-
assert_equal "
|
137
|
-
|
138
|
-
assert_equal "
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
16
|
+
assert_equal "Labour Day", (Holidays.on(Date.civil(2016, 5, 2), [:au_qld])[0] || {})[:name]
|
17
|
+
|
18
|
+
assert_equal "Queen's Birthday", (Holidays.on(Date.civil(2012, 6, 11), [:au_qld])[0] || {})[:name]
|
19
|
+
assert_equal "Queen's Birthday", (Holidays.on(Date.civil(2012, 10, 1), [:au_qld])[0] || {})[:name]
|
20
|
+
assert_equal "Queen's Birthday", (Holidays.on(Date.civil(2013, 6, 10), [:au_qld])[0] || {})[:name]
|
21
|
+
assert_equal "Queen's Birthday", (Holidays.on(Date.civil(2015, 6, 8), [:au_qld])[0] || {})[:name]
|
22
|
+
assert_equal "Queen's Birthday", (Holidays.on(Date.civil(2016, 10, 3), [:au_qld])[0] || {})[:name]
|
23
|
+
|
24
|
+
assert_equal "Queen's Birthday", (Holidays.on(Date.civil(2014, 9, 29), [:au_wa])[0] || {})[:name]
|
25
|
+
assert_equal "Queen's Birthday", (Holidays.on(Date.civil(2015, 9, 28), [:au_wa])[0] || {})[:name]
|
26
|
+
assert_equal "Queen's Birthday", (Holidays.on(Date.civil(2016, 9, 26), [:au_wa])[0] || {})[:name]
|
27
|
+
|
28
|
+
assert_equal "Family & Community Day", (Holidays.on(Date.civil(2014, 9, 29), [:au_act])[0] || {})[:name]
|
29
|
+
|
30
|
+
assert_equal "Family & Community Day", (Holidays.on(Date.civil(2015, 9, 28), [:au_act])[0] || {})[:name]
|
31
|
+
|
32
|
+
assert_equal "Family & Community Day", (Holidays.on(Date.civil(2016, 9, 26), [:au_act])[0] || {})[:name]
|
33
|
+
|
34
|
+
assert_equal "Australia Day", (Holidays.on(Date.civil(2014, 1, 26), [:au_qld])[0] || {})[:name]
|
35
|
+
|
36
|
+
assert_equal "Australia Day", (Holidays.on(Date.civil(2014, 1, 27), [:au_qld], [:observed])[0] || {})[:name]
|
37
|
+
|
38
|
+
assert_equal "Cairns Show", (Holidays.on(Date.civil(2014, 7, 18), [:au_qld_cairns])[0] || {})[:name]
|
39
|
+
|
40
|
+
assert_equal "Cairns Show", (Holidays.on(Date.civil(2013, 7, 19), [:au_qld_cairns])[0] || {})[:name]
|
41
|
+
|
42
|
+
assert_equal "Royal Hobart Show", (Holidays.on(Date.civil(2013, 10, 24), [:au_tas_south])[0] || {})[:name]
|
43
|
+
|
44
|
+
assert_equal "Royal Hobart Show", (Holidays.on(Date.civil(2014, 10, 23), [:au_tas_south])[0] || {})[:name]
|
45
|
+
|
46
|
+
assert_equal "Royal Hobart Show", (Holidays.on(Date.civil(2015, 10, 22), [:au_tas_south])[0] || {})[:name]
|
47
|
+
|
48
|
+
assert_equal "Royal Hobart Show", (Holidays.on(Date.civil(2016, 10, 20), [:au_tas_south])[0] || {})[:name]
|
49
|
+
|
50
|
+
assert_equal "Recreation Day", (Holidays.on(Date.civil(2013, 11, 4), [:au_tas_north])[0] || {})[:name]
|
51
|
+
|
52
|
+
assert_equal "Recreation Day", (Holidays.on(Date.civil(2014, 11, 3), [:au_tas_north])[0] || {})[:name]
|
53
|
+
|
54
|
+
assert_equal "Recreation Day", (Holidays.on(Date.civil(2015, 11, 2), [:au_tas_north])[0] || {})[:name]
|
55
|
+
|
56
|
+
assert_equal "Recreation Day", (Holidays.on(Date.civil(2016, 11, 7), [:au_tas_north])[0] || {})[:name]
|
57
|
+
|
58
|
+
assert_nil (Holidays.on(Date.civil(2015, 12, 26), [:au_tas])[0] || {})[:name]
|
59
|
+
|
60
|
+
assert_nil (Holidays.on(Date.civil(2015, 11, 14), [:au_qld_brisbane])[0] || {})[:name]
|
61
|
+
|
62
|
+
assert_nil (Holidays.on(Date.civil(2015, 12, 26), [:au_nt])[0] || {})[:name]
|
63
|
+
|
64
|
+
assert_equal "Proclamation Day", (Holidays.on(Date.civil(2016, 12, 27), [:au_sa])[0] || {})[:name]
|
65
|
+
|
66
|
+
assert_equal "Christmas Day", (Holidays.on(Date.civil(2016, 12, 25), [:au_nt])[0] || {})[:name]
|
67
|
+
|
68
|
+
assert_nil (Holidays.on(Date.civil(2014, 11, 4), [:au_vic])[0] || {})[:name]
|
69
|
+
|
70
|
+
assert_nil (Holidays.on(Date.civil(2015, 11, 3), [:au_vic])[0] || {})[:name]
|
71
|
+
|
72
|
+
assert_equal "Christmas Day", (Holidays.on(Date.civil(2016, 12, 25), [:au_vic])[0] || {})[:name]
|
73
|
+
|
74
|
+
assert_nil (Holidays.on(Date.civil(2014, 5, 19), [:au_sa])[0] || {})[:name]
|
75
|
+
|
76
|
+
assert_nil (Holidays.on(Date.civil(2005, 3, 14), [:au_sa])[0] || {})[:name]
|
77
|
+
|
78
|
+
assert_nil (Holidays.on(Date.civil(2015, 12, 26), [:au_sa])[0] || {})[:name]
|
79
|
+
|
80
|
+
assert_nil (Holidays.on(Date.civil(2015, 4, 27), [:au_qld], [:observed])[0] || {})[:name]
|
81
|
+
|
82
|
+
assert_nil (Holidays.on(Date.civil(2014, 11, 14), [:au_qld])[0] || {})[:name]
|
83
|
+
|
84
|
+
assert_equal "Melbourne Cup Day", (Holidays.on(Date.civil(2014, 11, 4), [:au_vic_melbourne])[0] || {})[:name]
|
85
|
+
|
86
|
+
assert_equal "Melbourne Cup Day", (Holidays.on(Date.civil(2015, 11, 3), [:au_vic_melbourne])[0] || {})[:name]
|
87
|
+
|
88
|
+
assert_equal "Friday before the AFL Grand Final", (Holidays.on(Date.civil(2015, 10, 2), [:au_vic])[0] || {})[:name]
|
89
|
+
|
90
|
+
assert_equal "Friday before the AFL Grand Final", (Holidays.on(Date.civil(2016, 9, 30), [:au_vic])[0] || {})[:name]
|
91
|
+
|
92
|
+
assert_equal "Friday before the AFL Grand Final", (Holidays.on(Date.civil(2017, 9, 29), [:au_vic])[0] || {})[:name]
|
93
|
+
|
94
|
+
assert_equal "May Public Holiday", (Holidays.on(Date.civil(2005, 5, 16), [:au_sa])[0] || {})[:name]
|
95
|
+
|
96
|
+
assert_equal "March Public Holiday", (Holidays.on(Date.civil(2014, 3, 10), [:au_sa])[0] || {})[:name]
|
97
|
+
|
98
|
+
assert_equal "March Public Holiday", (Holidays.on(Date.civil(2015, 3, 9), [:au_sa])[0] || {})[:name]
|
99
|
+
|
100
|
+
assert_equal "March Public Holiday", (Holidays.on(Date.civil(2016, 3, 14), [:au_sa])[0] || {})[:name]
|
101
|
+
|
102
|
+
assert_equal "March Public Holiday", (Holidays.on(Date.civil(2017, 3, 13), [:au_sa])[0] || {})[:name]
|
103
|
+
|
104
|
+
assert_equal "ANZAC Day", (Holidays.on(Date.civil(2015, 4, 25), [:au_qld, :au_wa])[0] || {})[:name]
|
105
|
+
|
106
|
+
assert_equal "ANZAC Day", (Holidays.on(Date.civil(2015, 4, 27), [:au_wa], [:observed])[0] || {})[:name]
|
107
|
+
|
108
|
+
assert_equal "Boxing Day", (Holidays.on(Date.civil(2015, 12, 26), [:au_qld])[0] || {})[:name]
|
109
|
+
|
110
|
+
assert_equal "Boxing Day", (Holidays.on(Date.civil(2015, 12, 28), [:au_qld], [:observed])[0] || {})[:name]
|
111
|
+
|
112
|
+
assert_nil (Holidays.on(Date.civil(2015, 12, 26), [:au_sa])[0] || {})[:name]
|
113
|
+
|
114
|
+
assert_equal "Proclamation Day", (Holidays.on(Date.civil(2015, 12, 28), [:au_sa])[0] || {})[:name]
|
115
|
+
|
116
|
+
assert_nil (Holidays.on(Date.civil(2015, 12, 26), [:au_tas])[0] || {})[:name]
|
117
|
+
|
118
|
+
assert_equal "Boxing Day", (Holidays.on(Date.civil(2015, 12, 28), [:au_tas])[0] || {})[:name]
|
119
|
+
|
120
|
+
assert_nil (Holidays.on(Date.civil(2015, 12, 26), [:au_nt])[0] || {})[:name]
|
121
|
+
|
122
|
+
assert_equal "Boxing Day", (Holidays.on(Date.civil(2015, 12, 28), [:au_nt])[0] || {})[:name]
|
123
|
+
|
124
|
+
assert_equal "Royal Hobart Regatta", (Holidays.on(Date.civil(2012, 2, 13), [:au_tas_south])[0] || {})[:name]
|
125
|
+
|
126
|
+
assert_equal "Royal Hobart Regatta", (Holidays.on(Date.civil(2014, 2, 10), [:au_tas_south])[0] || {})[:name]
|
127
|
+
|
128
|
+
assert_equal "Royal Hobart Regatta", (Holidays.on(Date.civil(2015, 2, 9), [:au_tas_south])[0] || {})[:name]
|
129
|
+
|
130
|
+
assert_equal "Royal Hobart Regatta", (Holidays.on(Date.civil(2016, 2, 8), [:au_tas_south])[0] || {})[:name]
|
131
|
+
|
132
|
+
assert_equal "Christmas Day", (Holidays.on(Date.civil(2016, 12, 25), [:au_qld])[0] || {})[:name]
|
133
|
+
|
134
|
+
assert_equal "Christmas Day", (Holidays.on(Date.civil(2016, 12, 27), [:au_qld], [:observed])[0] || {})[:name]
|
135
|
+
|
136
|
+
assert_equal "Christmas Day", (Holidays.on(Date.civil(2016, 12, 25), [:au_nsw])[0] || {})[:name]
|
137
|
+
|
138
|
+
assert_equal "Christmas Day", (Holidays.on(Date.civil(2016, 12, 27), [:au_nsw], [:observed])[0] || {})[:name]
|
139
|
+
|
140
|
+
assert_equal "Christmas Day", (Holidays.on(Date.civil(2016, 12, 25), [:au_act])[0] || {})[:name]
|
141
|
+
|
142
|
+
assert_equal "Christmas Day", (Holidays.on(Date.civil(2016, 12, 27), [:au_act], [:observed])[0] || {})[:name]
|
143
|
+
|
144
|
+
assert_equal "Christmas Day", (Holidays.on(Date.civil(2016, 12, 25), [:au_tas])[0] || {})[:name]
|
145
|
+
|
146
|
+
assert_equal "Christmas Day", (Holidays.on(Date.civil(2016, 12, 27), [:au_tas], [:observed])[0] || {})[:name]
|
147
|
+
|
148
|
+
assert_equal "Christmas Day", (Holidays.on(Date.civil(2016, 12, 25), [:au_wa])[0] || {})[:name]
|
149
|
+
|
150
|
+
assert_equal "Christmas Day", (Holidays.on(Date.civil(2016, 12, 27), [:au_wa], [:observed])[0] || {})[:name]
|
151
|
+
|
152
|
+
assert_equal "Christmas Day", (Holidays.on(Date.civil(2016, 12, 25), [:au_sa])[0] || {})[:name]
|
153
|
+
|
154
|
+
assert_equal "Christmas Day", (Holidays.on(Date.civil(2016, 12, 26), [:au_sa], [:observed])[0] || {})[:name]
|
155
|
+
|
156
|
+
assert_equal "Christmas Day", (Holidays.on(Date.civil(2016, 12, 25), [:au_nsw])[0] || {})[:name]
|
157
|
+
|
158
|
+
assert_equal "Christmas Day", (Holidays.on(Date.civil(2016, 12, 27), [:au_nsw], [:observed])[0] || {})[:name]
|
159
|
+
|
160
|
+
assert_equal "Christmas Day", (Holidays.on(Date.civil(2016, 12, 25), [:au_act])[0] || {})[:name]
|
161
|
+
|
162
|
+
assert_equal "Christmas Day", (Holidays.on(Date.civil(2016, 12, 27), [:au_act], [:observed])[0] || {})[:name]
|
163
|
+
|
164
|
+
assert_equal "Christmas Day", (Holidays.on(Date.civil(2016, 12, 25), [:au_tas])[0] || {})[:name]
|
165
|
+
|
166
|
+
assert_equal "Christmas Day", (Holidays.on(Date.civil(2016, 12, 27), [:au_tas], [:observed])[0] || {})[:name]
|
167
|
+
|
168
|
+
assert_equal "Christmas Day", (Holidays.on(Date.civil(2016, 12, 25), [:au_wa])[0] || {})[:name]
|
169
|
+
|
170
|
+
assert_equal "Christmas Day", (Holidays.on(Date.civil(2016, 12, 27), [:au_wa], [:observed])[0] || {})[:name]
|
171
|
+
|
172
|
+
assert_equal "Christmas Day", (Holidays.on(Date.civil(2016, 12, 25), [:au_sa])[0] || {})[:name]
|
173
|
+
|
174
|
+
assert_equal "Christmas Day", (Holidays.on(Date.civil(2016, 12, 26), [:au_sa], [:observed])[0] || {})[:name]
|
175
|
+
|
176
|
+
assert_equal "Christmas Day", (Holidays.on(Date.civil(2016, 12, 27), [:au_vic], [:observed])[0] || {})[:name]
|
177
|
+
|
178
|
+
assert_equal "Christmas Day", (Holidays.on(Date.civil(2016, 12, 27), [:au_nt], [:observed])[0] || {})[:name]
|
179
|
+
|
180
|
+
assert_equal "New Year's Day", (Holidays.on(Date.civil(2017, 1, 1), [:au, :au_qld, :au_nsw, :au_act, :au_vic, :au_sa, :au_wa, :au_nt])[0] || {})[:name]
|
181
|
+
|
182
|
+
assert_equal "New Year's Day", (Holidays.on(Date.civil(2017, 1, 2), [:au, :au_qld, :au_nsw, :au_act, :au_vic, :au_sa, :au_wa, :au_nt], [:observed])[0] || {})[:name]
|
147
183
|
|
148
|
-
|
149
|
-
#FIXME This commented test is valid but the current code in the ruby repo won't allow it
|
150
|
-
# to work. We need to discuss potential solutions but in the meantime I'm taking it out.
|
151
|
-
#assert_equal [], Date.civil(2017,1,1).holidays(:au_tas)
|
152
|
-
assert_equal "New Year's Day", Date.civil(2017, 1, 2).holidays(:au_tas)[0][:name]
|
184
|
+
assert_equal "New Year's Day", (Holidays.on(Date.civil(2017, 1, 2), [:au_tas])[0] || {})[:name]
|
153
185
|
|
154
|
-
|
155
|
-
assert_equal "Easter Sunday", Date.civil(2017, 4, 16).holidays(:au_qld)[0][:name]
|
186
|
+
assert_equal "Easter Sunday", (Holidays.on(Date.civil(2017, 4, 16), [:au_qld])[0] || {})[:name]
|
156
187
|
|
157
188
|
end
|
158
189
|
end
|