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_ge.rb
CHANGED
@@ -7,35 +7,47 @@ require File.expand_path(File.dirname(__FILE__)) + '/../test_helper'
|
|
7
7
|
class GeDefinitionTests < Test::Unit::TestCase # :nodoc:
|
8
8
|
|
9
9
|
def test_ge
|
10
|
-
|
11
|
-
Date.civil(2017, 1, 2) => 'ბედობა',
|
12
|
-
Date.civil(2017, 1, 7) => 'ქრისტეშობა',
|
13
|
-
Date.civil(2017, 1, 19) => 'ნათლისღება',
|
14
|
-
Date.civil(2017, 3, 3) => 'დედის დღე',
|
15
|
-
Date.civil(2017, 3, 8) => 'ქალთა საერთაშორისო დღე',
|
16
|
-
Date.civil(2017, 4, 9) => 'ეროვნული ერთიანობის დღე',
|
17
|
-
Date.civil(2017, 5, 9) => 'ფაშიზმზე გამარჯვების დღე',
|
18
|
-
Date.civil(2017, 5, 12) => 'წმინდა მოციქულის ანდრია პირველწოდებულის საქართველოში შემოსვლის დღე',
|
19
|
-
Date.civil(2017, 5, 26) => 'დამოუკიდებლობის დღე',
|
20
|
-
Date.civil(2017, 8, 28) => 'მარიამობა',
|
21
|
-
Date.civil(2017, 10, 14) => 'სვეტიცხოვლობა',
|
22
|
-
Date.civil(2017, 11, 23) => 'გიორგობა'
|
23
|
-
}.each do |date, name|
|
24
|
-
assert_equal name, (Holidays.on(date, :ge)[0] || {})[:name]
|
25
|
-
end
|
10
|
+
assert_equal "ახალი წელი", (Holidays.on(Date.civil(2017, 1, 1), [:ge])[0] || {})[:name]
|
26
11
|
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
12
|
+
assert_equal "ბედობა", (Holidays.on(Date.civil(2017, 1, 2), [:ge])[0] || {})[:name]
|
13
|
+
|
14
|
+
assert_equal "ქრისტეშობა", (Holidays.on(Date.civil(2017, 1, 7), [:ge])[0] || {})[:name]
|
15
|
+
|
16
|
+
assert_equal "ნათლისღება", (Holidays.on(Date.civil(2017, 1, 19), [:ge])[0] || {})[:name]
|
17
|
+
|
18
|
+
assert_equal "დედის დღე", (Holidays.on(Date.civil(2017, 3, 3), [:ge])[0] || {})[:name]
|
19
|
+
|
20
|
+
assert_equal "ქალთა საერთაშორისო დღე", (Holidays.on(Date.civil(2017, 3, 8), [:ge])[0] || {})[:name]
|
21
|
+
|
22
|
+
assert_equal "ეროვნული ერთიანობის დღე", (Holidays.on(Date.civil(2017, 4, 9), [:ge])[0] || {})[:name]
|
23
|
+
|
24
|
+
assert_equal "ფაშიზმზე გამარჯვების დღე", (Holidays.on(Date.civil(2017, 5, 9), [:ge])[0] || {})[:name]
|
25
|
+
|
26
|
+
assert_equal "წმინდა მოციქულის ანდრია პირველწოდებულის საქართველოში შემოსვლის დღე", (Holidays.on(Date.civil(2017, 5, 12), [:ge])[0] || {})[:name]
|
27
|
+
|
28
|
+
assert_equal "დამოუკიდებლობის დღე", (Holidays.on(Date.civil(2017, 5, 26), [:ge])[0] || {})[:name]
|
29
|
+
|
30
|
+
assert_equal "მარიამობა", (Holidays.on(Date.civil(2017, 8, 28), [:ge])[0] || {})[:name]
|
31
|
+
|
32
|
+
assert_equal "სვეტიცხოვლობა", (Holidays.on(Date.civil(2017, 10, 14), [:ge])[0] || {})[:name]
|
33
|
+
|
34
|
+
assert_equal "გიორგობა", (Holidays.on(Date.civil(2017, 11, 23), [:ge])[0] || {})[:name]
|
35
|
+
|
36
|
+
assert_equal "დიდი პარასკევი", (Holidays.on(Date.civil(2017, 4, 14), [:ge])[0] || {})[:name]
|
37
|
+
assert_equal "დიდი პარასკევი", (Holidays.on(Date.civil(2018, 4, 6), [:ge])[0] || {})[:name]
|
38
|
+
assert_equal "დიდი პარასკევი", (Holidays.on(Date.civil(2019, 4, 26), [:ge])[0] || {})[:name]
|
39
|
+
|
40
|
+
assert_equal "დიდი შაბათი", (Holidays.on(Date.civil(2017, 4, 15), [:ge])[0] || {})[:name]
|
41
|
+
assert_equal "დიდი შაბათი", (Holidays.on(Date.civil(2018, 4, 7), [:ge])[0] || {})[:name]
|
42
|
+
assert_equal "დიდი შაბათი", (Holidays.on(Date.civil(2019, 4, 27), [:ge])[0] || {})[:name]
|
43
|
+
|
44
|
+
assert_equal "ბრწყინვალე აღდგომის დღე", (Holidays.on(Date.civil(2017, 4, 16), [:ge])[0] || {})[:name]
|
45
|
+
assert_equal "ბრწყინვალე აღდგომის დღე", (Holidays.on(Date.civil(2018, 4, 8), [:ge])[0] || {})[:name]
|
46
|
+
assert_equal "ბრწყინვალე აღდგომის დღე", (Holidays.on(Date.civil(2019, 4, 28), [:ge])[0] || {})[:name]
|
47
|
+
|
48
|
+
assert_equal "მიცვალებულთა", (Holidays.on(Date.civil(2017, 4, 17), [:ge])[0] || {})[:name]
|
49
|
+
assert_equal "მიცვალებულთა", (Holidays.on(Date.civil(2018, 4, 9), [:ge])[0] || {})[:name]
|
50
|
+
assert_equal "მიცვალებულთა", (Holidays.on(Date.civil(2019, 4, 29), [:ge])[0] || {})[:name]
|
39
51
|
|
40
52
|
end
|
41
53
|
end
|
data/test/defs/test_defs_hk.rb
CHANGED
@@ -7,32 +7,53 @@ require File.expand_path(File.dirname(__FILE__)) + '/../test_helper'
|
|
7
7
|
class HkDefinitionTests < Test::Unit::TestCase # :nodoc:
|
8
8
|
|
9
9
|
def test_hk
|
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(
|
23
|
-
|
24
|
-
Date.civil(
|
25
|
-
|
26
|
-
Date.civil(
|
27
|
-
|
28
|
-
Date.civil(
|
29
|
-
|
30
|
-
Date.civil(
|
31
|
-
|
32
|
-
Date.civil(
|
33
|
-
|
34
|
-
|
35
|
-
|
10
|
+
assert_equal "New Year's Day", (Holidays.on(Date.civil(2016, 1, 1), [:hk], [:observed])[0] || {})[:name]
|
11
|
+
|
12
|
+
assert_equal "Lunar New Year's Day", (Holidays.on(Date.civil(2016, 2, 8), [:hk], [:observed])[0] || {})[:name]
|
13
|
+
|
14
|
+
assert_equal "The second day of Lunar New Year", (Holidays.on(Date.civil(2016, 2, 9), [:hk], [:observed])[0] || {})[:name]
|
15
|
+
|
16
|
+
assert_equal "The third day of Lunar New Year", (Holidays.on(Date.civil(2016, 2, 10), [:hk], [:observed])[0] || {})[:name]
|
17
|
+
|
18
|
+
assert_equal "Good Friday", (Holidays.on(Date.civil(2016, 3, 25), [:hk], [:observed])[0] || {})[:name]
|
19
|
+
|
20
|
+
assert_equal "The day following Good Friday", (Holidays.on(Date.civil(2016, 3, 26), [:hk], [:observed])[0] || {})[:name]
|
21
|
+
|
22
|
+
assert_equal "Easter Monday", (Holidays.on(Date.civil(2016, 3, 28), [:hk], [:observed])[0] || {})[:name]
|
23
|
+
|
24
|
+
assert_equal "Labour Day", (Holidays.on(Date.civil(2016, 5, 2), [:hk], [:observed])[0] || {})[:name]
|
25
|
+
|
26
|
+
assert_equal "Hong Kong Special Administrative Region Establishment Day", (Holidays.on(Date.civil(2016, 7, 1), [:hk], [:observed])[0] || {})[:name]
|
27
|
+
|
28
|
+
assert_equal "National Day", (Holidays.on(Date.civil(2016, 10, 1), [:hk], [:observed])[0] || {})[:name]
|
29
|
+
|
30
|
+
assert_equal "Christmas Day", (Holidays.on(Date.civil(2016, 12, 26), [:hk], [:observed])[0] || {})[:name]
|
31
|
+
|
32
|
+
assert_equal "Boxing Day", (Holidays.on(Date.civil(2016, 12, 27), [:hk], [:observed])[0] || {})[:name]
|
33
|
+
|
34
|
+
assert_equal "New Year's Day", (Holidays.on(Date.civil(2017, 1, 2), [:hk], [:observed])[0] || {})[:name]
|
35
|
+
|
36
|
+
assert_equal "Lunar New Year's Day", (Holidays.on(Date.civil(2017, 1, 28), [:hk], [:observed])[0] || {})[:name]
|
37
|
+
|
38
|
+
assert_equal "The second day of Lunar New Year", (Holidays.on(Date.civil(2017, 1, 30), [:hk], [:observed])[0] || {})[:name]
|
39
|
+
|
40
|
+
assert_equal "The third day of Lunar New Year", (Holidays.on(Date.civil(2017, 1, 31), [:hk], [:observed])[0] || {})[:name]
|
41
|
+
|
42
|
+
assert_equal "Good Friday", (Holidays.on(Date.civil(2017, 4, 14), [:hk], [:observed])[0] || {})[:name]
|
43
|
+
|
44
|
+
assert_equal "The day following Good Friday", (Holidays.on(Date.civil(2017, 4, 15), [:hk], [:observed])[0] || {})[:name]
|
45
|
+
|
46
|
+
assert_equal "Easter Monday", (Holidays.on(Date.civil(2017, 4, 17), [:hk], [:observed])[0] || {})[:name]
|
47
|
+
|
48
|
+
assert_equal "Labour Day", (Holidays.on(Date.civil(2017, 5, 1), [:hk], [:observed])[0] || {})[:name]
|
49
|
+
|
50
|
+
assert_equal "Hong Kong Special Administrative Region Establishment Day", (Holidays.on(Date.civil(2017, 7, 1), [:hk], [:observed])[0] || {})[:name]
|
51
|
+
|
52
|
+
assert_equal "National Day", (Holidays.on(Date.civil(2017, 10, 2), [:hk], [:observed])[0] || {})[:name]
|
53
|
+
|
54
|
+
assert_equal "Christmas Day", (Holidays.on(Date.civil(2017, 12, 25), [:hk], [:observed])[0] || {})[:name]
|
55
|
+
|
56
|
+
assert_equal "Boxing Day", (Holidays.on(Date.civil(2017, 12, 26), [:hk], [:observed])[0] || {})[:name]
|
36
57
|
|
37
58
|
end
|
38
59
|
end
|
data/test/defs/test_defs_hr.rb
CHANGED
@@ -7,25 +7,39 @@ require File.expand_path(File.dirname(__FILE__)) + '/../test_helper'
|
|
7
7
|
class HrDefinitionTests < Test::Unit::TestCase # :nodoc:
|
8
8
|
|
9
9
|
def test_hr
|
10
|
-
|
11
|
-
Date.civil(2012,1,6) => 'Sveta tri kralja',
|
12
|
-
Date.civil(2012,5,1) => 'Međunarodni praznik rada',
|
13
|
-
Date.civil(2012,6,22) => 'Dan antifašističke borbe',
|
14
|
-
Date.civil(2012,6,25) => 'Dan državnosti',
|
15
|
-
Date.civil(2012,8,5) => 'Dan pobjede i domovinske zahvalnosti i dan hrvatskih branitelja',
|
16
|
-
Date.civil(2012,8,15) => 'Velika Gospa',
|
17
|
-
Date.civil(2012,10,8) => 'Dan neovisnosti',
|
18
|
-
Date.civil(2012,11,1) => 'Dan svih svetih',
|
19
|
-
Date.civil(2012,12,25) => 'Božić',
|
20
|
-
Date.civil(2012,12,26) => 'Sveti Stjepan'}.each do |date, name|
|
21
|
-
assert_equal name, (Holidays.on(date, :hr, :informal)[0] || {})[:name]
|
22
|
-
end
|
10
|
+
assert_equal "Nova godina", (Holidays.on(Date.civil(2012, 1, 1), [:hr], [:informal])[0] || {})[:name]
|
23
11
|
|
24
|
-
|
25
|
-
|
26
|
-
Date.civil(2012,
|
27
|
-
|
28
|
-
|
12
|
+
assert_equal "Sveta tri kralja", (Holidays.on(Date.civil(2012, 1, 6), [:hr], [:informal])[0] || {})[:name]
|
13
|
+
|
14
|
+
assert_equal "Međunarodni praznik rada", (Holidays.on(Date.civil(2012, 5, 1), [:hr], [:informal])[0] || {})[:name]
|
15
|
+
|
16
|
+
assert_equal "Dan antifašističke borbe", (Holidays.on(Date.civil(2012, 6, 22), [:hr], [:informal])[0] || {})[:name]
|
17
|
+
|
18
|
+
assert_equal "Dan državnosti", (Holidays.on(Date.civil(2012, 6, 25), [:hr], [:informal])[0] || {})[:name]
|
19
|
+
|
20
|
+
assert_equal "Dan pobjede i domovinske zahvalnosti i dan hrvatskih branitelja", (Holidays.on(Date.civil(2012, 8, 5), [:hr], [:informal])[0] || {})[:name]
|
21
|
+
|
22
|
+
assert_equal "Velika Gospa", (Holidays.on(Date.civil(2012, 8, 15), [:hr], [:informal])[0] || {})[:name]
|
23
|
+
|
24
|
+
assert_equal "Dan neovisnosti", (Holidays.on(Date.civil(2012, 10, 8), [:hr], [:informal])[0] || {})[:name]
|
25
|
+
|
26
|
+
assert_equal "Dan svih svetih", (Holidays.on(Date.civil(2012, 11, 1), [:hr], [:informal])[0] || {})[:name]
|
27
|
+
|
28
|
+
assert_equal "Božić", (Holidays.on(Date.civil(2012, 12, 25), [:hr], [:informal])[0] || {})[:name]
|
29
|
+
|
30
|
+
assert_equal "Sveti Stjepan", (Holidays.on(Date.civil(2012, 12, 26), [:hr], [:informal])[0] || {})[:name]
|
31
|
+
|
32
|
+
assert_equal "Tijelovo", (Holidays.on(Date.civil(2008, 5, 22), [:hr])[0] || {})[:name]
|
33
|
+
|
34
|
+
assert_equal "Tijelovo", (Holidays.on(Date.civil(2009, 6, 11), [:hr])[0] || {})[:name]
|
35
|
+
|
36
|
+
assert_equal "Tijelovo", (Holidays.on(Date.civil(2010, 6, 3), [:hr])[0] || {})[:name]
|
37
|
+
|
38
|
+
assert_equal "Tijelovo", (Holidays.on(Date.civil(2012, 6, 7), [:hr])[0] || {})[:name]
|
39
|
+
|
40
|
+
assert_equal "Tijelovo", (Holidays.on(Date.civil(2013, 5, 30), [:hr])[0] || {})[:name]
|
41
|
+
|
42
|
+
assert_equal "Tijelovo", (Holidays.on(Date.civil(2014, 6, 19), [:hr])[0] || {})[:name]
|
29
43
|
|
30
44
|
end
|
31
45
|
end
|
data/test/defs/test_defs_hu.rb
CHANGED
@@ -7,23 +7,33 @@ require File.expand_path(File.dirname(__FILE__)) + '/../test_helper'
|
|
7
7
|
class HuDefinitionTests < Test::Unit::TestCase # :nodoc:
|
8
8
|
|
9
9
|
def test_hu
|
10
|
-
|
11
|
-
|
12
|
-
Date.civil(
|
13
|
-
|
14
|
-
Date.civil(2012,
|
15
|
-
|
16
|
-
Date.civil(2011,
|
17
|
-
|
18
|
-
Date.civil(2012,
|
19
|
-
|
20
|
-
Date.civil(2012,
|
21
|
-
|
22
|
-
Date.civil(
|
23
|
-
|
24
|
-
|
10
|
+
assert_equal "Újév", (Holidays.on(Date.civil(2012, 1, 1), [:hu], [:informal])[0] || {})[:name]
|
11
|
+
|
12
|
+
assert_equal "Újév", (Holidays.on(Date.civil(2011, 1, 1), [:hu], [:informal])[0] || {})[:name]
|
13
|
+
|
14
|
+
assert_equal "1848/49-es forradalom és szabadságharc ünnepe", (Holidays.on(Date.civil(2012, 3, 15), [:hu], [:informal])[0] || {})[:name]
|
15
|
+
|
16
|
+
assert_equal "Húsvét hétfő", (Holidays.on(Date.civil(2011, 4, 25), [:hu], [:informal])[0] || {})[:name]
|
17
|
+
|
18
|
+
assert_equal "Húsvét hétfő", (Holidays.on(Date.civil(2012, 4, 9), [:hu], [:informal])[0] || {})[:name]
|
19
|
+
|
20
|
+
assert_equal "A munka ünnepe", (Holidays.on(Date.civil(2012, 5, 1), [:hu], [:informal])[0] || {})[:name]
|
21
|
+
|
22
|
+
assert_equal "Pünkösd hétfő", (Holidays.on(Date.civil(2011, 6, 13), [:hu], [:informal])[0] || {})[:name]
|
23
|
+
|
24
|
+
assert_equal "Pünkösd hétfő", (Holidays.on(Date.civil(2012, 5, 28), [:hu], [:informal])[0] || {})[:name]
|
25
|
+
|
26
|
+
assert_equal "Az államalapítás ünnepe", (Holidays.on(Date.civil(2012, 8, 20), [:hu], [:informal])[0] || {})[:name]
|
27
|
+
|
28
|
+
assert_equal "1956-os forradalom és szabadságharc ünnepe", (Holidays.on(Date.civil(2012, 10, 23), [:hu], [:informal])[0] || {})[:name]
|
29
|
+
|
30
|
+
assert_equal "Mindenszentek", (Holidays.on(Date.civil(2012, 11, 1), [:hu], [:informal])[0] || {})[:name]
|
31
|
+
|
32
|
+
assert_equal "Karácsony", (Holidays.on(Date.civil(2012, 12, 25), [:hu], [:informal])[0] || {})[:name]
|
33
|
+
|
34
|
+
assert_equal "Karácsony", (Holidays.on(Date.civil(2012, 12, 26), [:hu], [:informal])[0] || {})[:name]
|
25
35
|
|
26
|
-
|
36
|
+
assert_nil (Holidays.on(Date.civil(2012, 3, 14), [:hu])[0] || {})[:name]
|
27
37
|
|
28
38
|
end
|
29
39
|
end
|
data/test/defs/test_defs_ie.rb
CHANGED
@@ -7,31 +7,47 @@ require File.expand_path(File.dirname(__FILE__)) + '/../test_helper'
|
|
7
7
|
class IeDefinitionTests < Test::Unit::TestCase # :nodoc:
|
8
8
|
|
9
9
|
def test_ie
|
10
|
-
|
11
|
-
|
12
|
-
Date.civil(2008,3,
|
13
|
-
|
14
|
-
Date.civil(2008,
|
15
|
-
|
16
|
-
Date.civil(2008,
|
17
|
-
|
18
|
-
Date.civil(2008,
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
Date.civil(
|
23
|
-
|
24
|
-
Date.civil(
|
25
|
-
|
26
|
-
Date.civil(
|
27
|
-
|
28
|
-
Date.civil(
|
29
|
-
|
30
|
-
Date.civil(2012,
|
31
|
-
|
32
|
-
Date.civil(
|
33
|
-
|
34
|
-
|
10
|
+
assert_equal "New Year's Day", (Holidays.on(Date.civil(2008, 1, 1), [:ie])[0] || {})[:name]
|
11
|
+
|
12
|
+
assert_equal "St. Patrick's Day", (Holidays.on(Date.civil(2008, 3, 17), [:ie])[0] || {})[:name]
|
13
|
+
|
14
|
+
assert_equal "Easter Monday", (Holidays.on(Date.civil(2008, 3, 24), [:ie])[0] || {})[:name]
|
15
|
+
|
16
|
+
assert_equal "May Day", (Holidays.on(Date.civil(2008, 5, 5), [:ie])[0] || {})[:name]
|
17
|
+
|
18
|
+
assert_equal "June Bank Holiday", (Holidays.on(Date.civil(2008, 6, 2), [:ie])[0] || {})[:name]
|
19
|
+
|
20
|
+
assert_equal "August Bank Holiday", (Holidays.on(Date.civil(2008, 8, 4), [:ie])[0] || {})[:name]
|
21
|
+
|
22
|
+
assert_equal "October Bank Holiday", (Holidays.on(Date.civil(2008, 10, 27), [:ie])[0] || {})[:name]
|
23
|
+
|
24
|
+
assert_equal "Christmas Day", (Holidays.on(Date.civil(2008, 12, 25), [:ie])[0] || {})[:name]
|
25
|
+
|
26
|
+
assert_equal "St. Stephen's Day", (Holidays.on(Date.civil(2008, 12, 26), [:ie])[0] || {})[:name]
|
27
|
+
|
28
|
+
assert_equal "New Year's Day", (Holidays.on(Date.civil(2012, 1, 2), [:ie], [:observed])[0] || {})[:name]
|
29
|
+
|
30
|
+
assert_equal "St. Patrick's Day", (Holidays.on(Date.civil(2012, 3, 19), [:ie], [:observed])[0] || {})[:name]
|
31
|
+
|
32
|
+
assert_equal "Easter Monday", (Holidays.on(Date.civil(2012, 4, 9), [:ie], [:observed])[0] || {})[:name]
|
33
|
+
|
34
|
+
assert_equal "May Day", (Holidays.on(Date.civil(2012, 5, 7), [:ie], [:observed])[0] || {})[:name]
|
35
|
+
|
36
|
+
assert_equal "June Bank Holiday", (Holidays.on(Date.civil(2012, 6, 4), [:ie], [:observed])[0] || {})[:name]
|
37
|
+
|
38
|
+
assert_equal "August Bank Holiday", (Holidays.on(Date.civil(2012, 8, 6), [:ie], [:observed])[0] || {})[:name]
|
39
|
+
|
40
|
+
assert_equal "October Bank Holiday", (Holidays.on(Date.civil(2012, 10, 29), [:ie], [:observed])[0] || {})[:name]
|
41
|
+
|
42
|
+
assert_equal "Christmas Day", (Holidays.on(Date.civil(2011, 12, 26), [:ie], [:observed])[0] || {})[:name]
|
43
|
+
|
44
|
+
assert_equal "St. Stephen's Day", (Holidays.on(Date.civil(2011, 12, 27), [:ie], [:observed])[0] || {})[:name]
|
45
|
+
|
46
|
+
assert_equal "Christmas Day", (Holidays.on(Date.civil(2012, 12, 25), [:ie], [:observed])[0] || {})[:name]
|
47
|
+
|
48
|
+
assert_equal "St. Stephen's Day", (Holidays.on(Date.civil(2012, 12, 26), [:ie], [:observed])[0] || {})[:name]
|
49
|
+
|
50
|
+
assert_equal "St. Stephen's Day", (Holidays.on(Date.civil(2015, 12, 28), [:ie], [:observed])[0] || {})[:name]
|
35
51
|
|
36
52
|
end
|
37
53
|
end
|
data/test/defs/test_defs_is.rb
CHANGED
@@ -7,28 +7,45 @@ require File.expand_path(File.dirname(__FILE__)) + '/../test_helper'
|
|
7
7
|
class IsDefinitionTests < Test::Unit::TestCase # :nodoc:
|
8
8
|
|
9
9
|
def test_is
|
10
|
-
|
11
|
-
|
12
|
-
Date.civil(2007,1,
|
13
|
-
|
14
|
-
Date.civil(2007,
|
15
|
-
|
16
|
-
Date.civil(2007,
|
17
|
-
|
18
|
-
Date.civil(2007,4,
|
19
|
-
|
20
|
-
Date.civil(2007,
|
21
|
-
|
22
|
-
Date.civil(2007,
|
23
|
-
|
24
|
-
Date.civil(2007,
|
25
|
-
|
26
|
-
Date.civil(2007,
|
27
|
-
|
28
|
-
Date.civil(2007,
|
29
|
-
|
30
|
-
|
31
|
-
|
10
|
+
assert_equal "Nýársdagur", (Holidays.on(Date.civil(2007, 1, 1), [:is], [:informal])[0] || {})[:name]
|
11
|
+
|
12
|
+
assert_equal "Þrettándinn", (Holidays.on(Date.civil(2007, 1, 6), [:is], [:informal])[0] || {})[:name]
|
13
|
+
|
14
|
+
assert_equal "Bóndadagur", (Holidays.on(Date.civil(2007, 1, 19), [:is], [:informal])[0] || {})[:name]
|
15
|
+
|
16
|
+
assert_equal "Konudagur", (Holidays.on(Date.civil(2007, 2, 18), [:is], [:informal])[0] || {})[:name]
|
17
|
+
|
18
|
+
assert_equal "Skírdagur", (Holidays.on(Date.civil(2007, 4, 5), [:is], [:informal])[0] || {})[:name]
|
19
|
+
|
20
|
+
assert_equal "Föstudaginn langi", (Holidays.on(Date.civil(2007, 4, 6), [:is], [:informal])[0] || {})[:name]
|
21
|
+
|
22
|
+
assert_equal "Páskadagur", (Holidays.on(Date.civil(2007, 4, 8), [:is], [:informal])[0] || {})[:name]
|
23
|
+
|
24
|
+
assert_equal "Annar í páskum", (Holidays.on(Date.civil(2007, 4, 9), [:is], [:informal])[0] || {})[:name]
|
25
|
+
|
26
|
+
assert_equal "Sumardagurinn fyrsti", (Holidays.on(Date.civil(2007, 4, 19), [:is], [:informal])[0] || {})[:name]
|
27
|
+
|
28
|
+
assert_equal "Verkalýðsdagurinn", (Holidays.on(Date.civil(2007, 5, 1), [:is], [:informal])[0] || {})[:name]
|
29
|
+
|
30
|
+
assert_equal "Uppstigningardagur", (Holidays.on(Date.civil(2007, 5, 17), [:is], [:informal])[0] || {})[:name]
|
31
|
+
|
32
|
+
assert_equal "Hvítasunnudagur", (Holidays.on(Date.civil(2007, 5, 27), [:is], [:informal])[0] || {})[:name]
|
33
|
+
|
34
|
+
assert_equal "Annar í hvítasunnu", (Holidays.on(Date.civil(2007, 5, 28), [:is], [:informal])[0] || {})[:name]
|
35
|
+
|
36
|
+
assert_equal "Sjómannadagurinn", (Holidays.on(Date.civil(2007, 6, 3), [:is], [:informal])[0] || {})[:name]
|
37
|
+
|
38
|
+
assert_equal "Lýðveldisdagurinn", (Holidays.on(Date.civil(2007, 6, 17), [:is], [:informal])[0] || {})[:name]
|
39
|
+
|
40
|
+
assert_equal "Frídagur verslunarmanna", (Holidays.on(Date.civil(2007, 8, 6), [:is], [:informal])[0] || {})[:name]
|
41
|
+
|
42
|
+
assert_equal "Jól", (Holidays.on(Date.civil(2007, 12, 24), [:is], [:informal])[0] || {})[:name]
|
43
|
+
|
44
|
+
assert_equal "Jól", (Holidays.on(Date.civil(2007, 12, 25), [:is], [:informal])[0] || {})[:name]
|
45
|
+
|
46
|
+
assert_equal "Jól", (Holidays.on(Date.civil(2007, 12, 26), [:is], [:informal])[0] || {})[:name]
|
47
|
+
|
48
|
+
assert_equal "Gamlárskvöld", (Holidays.on(Date.civil(2007, 12, 31), [:is], [:informal])[0] || {})[:name]
|
32
49
|
|
33
50
|
end
|
34
51
|
end
|
data/test/defs/test_defs_it.rb
CHANGED
@@ -7,20 +7,29 @@ require File.expand_path(File.dirname(__FILE__)) + '/../test_helper'
|
|
7
7
|
class ItDefinitionTests < Test::Unit::TestCase # :nodoc:
|
8
8
|
|
9
9
|
def test_it
|
10
|
-
|
11
|
-
|
12
|
-
Date.civil(2007,
|
13
|
-
|
14
|
-
Date.civil(2007,4,
|
15
|
-
|
16
|
-
Date.civil(2007,
|
17
|
-
|
18
|
-
Date.civil(2007,
|
19
|
-
|
20
|
-
Date.civil(2007,
|
21
|
-
|
22
|
-
|
23
|
-
|
10
|
+
assert_equal "Capodanno", (Holidays.on(Date.civil(2007, 1, 1), [:it], [:informal])[0] || {})[:name]
|
11
|
+
|
12
|
+
assert_equal "Epifania", (Holidays.on(Date.civil(2007, 1, 6), [:it], [:informal])[0] || {})[:name]
|
13
|
+
|
14
|
+
assert_equal "Pasqua", (Holidays.on(Date.civil(2007, 4, 8), [:it], [:informal])[0] || {})[:name]
|
15
|
+
|
16
|
+
assert_equal "Lunedì dell'Angelo", (Holidays.on(Date.civil(2007, 4, 9), [:it], [:informal])[0] || {})[:name]
|
17
|
+
|
18
|
+
assert_equal "Festa della Liberazione", (Holidays.on(Date.civil(2007, 4, 25), [:it], [:informal])[0] || {})[:name]
|
19
|
+
|
20
|
+
assert_equal "Festa dei Lavoratori", (Holidays.on(Date.civil(2007, 5, 1), [:it], [:informal])[0] || {})[:name]
|
21
|
+
|
22
|
+
assert_equal "Festa della Repubblica", (Holidays.on(Date.civil(2007, 6, 2), [:it], [:informal])[0] || {})[:name]
|
23
|
+
|
24
|
+
assert_equal "Assunzione", (Holidays.on(Date.civil(2007, 8, 15), [:it], [:informal])[0] || {})[:name]
|
25
|
+
|
26
|
+
assert_equal "Ognissanti", (Holidays.on(Date.civil(2007, 11, 1), [:it], [:informal])[0] || {})[:name]
|
27
|
+
|
28
|
+
assert_equal "Immacolata Concezione", (Holidays.on(Date.civil(2007, 12, 8), [:it], [:informal])[0] || {})[:name]
|
29
|
+
|
30
|
+
assert_equal "Natale", (Holidays.on(Date.civil(2007, 12, 25), [:it], [:informal])[0] || {})[:name]
|
31
|
+
|
32
|
+
assert_equal "Santo Stefano", (Holidays.on(Date.civil(2007, 12, 26), [:it], [:informal])[0] || {})[:name]
|
24
33
|
|
25
34
|
end
|
26
35
|
end
|