holidays 0.9.3 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +3 -0
- data/CHANGELOG +7 -0
- data/{README → README.rdoc} +36 -39
- data/data/SYNTAX +1 -1
- data/data/au.yaml +110 -105
- data/data/build_defs.rb +4 -3
- data/data/ca.yaml +140 -140
- data/data/cz.yaml +68 -0
- data/data/de.yaml +12 -14
- data/data/dk.yaml +1 -1
- data/data/es.yaml +1 -1
- data/data/fr.yaml +1 -1
- data/data/gb.yaml +1 -1
- data/data/ie.yaml +1 -1
- data/data/index.yaml +7 -2
- data/data/is.yaml +1 -1
- data/data/it.yaml +1 -1
- data/data/mx.yaml +1 -1
- data/data/nl.yaml +1 -1
- data/data/no.yaml +82 -0
- data/data/nyse.yaml +1 -1
- data/data/nz.yaml +141 -0
- data/data/pt.yaml +1 -1
- data/data/se.yaml +1 -1
- data/data/united_nations.yaml +188 -188
- data/data/ups.yaml +55 -55
- data/data/us.yaml +80 -80
- data/data/za.yaml +1 -1
- data/holidays.gemspec +155 -0
- data/lib/holidays.rb +424 -403
- data/lib/holidays/MANIFEST +28 -25
- data/lib/holidays/au.rb +43 -41
- data/lib/holidays/ca.rb +69 -68
- data/lib/holidays/cz.rb +36 -0
- data/lib/holidays/de.rb +51 -52
- data/lib/holidays/dk.rb +48 -47
- data/lib/holidays/es.rb +53 -52
- data/lib/holidays/europe.rb +236 -215
- data/lib/holidays/fr.rb +37 -36
- data/lib/holidays/gb.rb +41 -40
- data/lib/holidays/ie.rb +33 -32
- data/lib/holidays/is.rb +62 -61
- data/lib/holidays/it.rb +36 -35
- data/lib/holidays/mx.rb +52 -51
- data/lib/holidays/nl.rb +37 -36
- data/lib/holidays/no.rb +40 -0
- data/lib/holidays/north_america.rb +108 -107
- data/lib/holidays/nyse.rb +33 -32
- data/lib/holidays/nz.rb +69 -0
- data/lib/holidays/pt.rb +38 -52
- data/lib/holidays/scandinavia.rb +124 -114
- data/lib/holidays/se.rb +53 -52
- data/lib/holidays/united_nations.rb +25 -24
- data/lib/holidays/ups.rb +32 -31
- data/lib/holidays/us.rb +49 -48
- data/lib/holidays/za.rb +36 -35
- data/rakefile.rb +105 -113
- data/test/defs/test_defs_au.rb +36 -36
- data/test/defs/test_defs_ca.rb +29 -29
- data/test/defs/test_defs_cz.rb +26 -0
- data/test/defs/test_defs_de.rb +51 -46
- data/test/defs/test_defs_dk.rb +30 -30
- data/test/defs/test_defs_es.rb +57 -57
- data/test/defs/test_defs_europe.rb +280 -240
- data/test/defs/test_defs_fr.rb +26 -26
- data/test/defs/test_defs_gb.rb +36 -36
- data/test/defs/test_defs_ie.rb +21 -21
- data/test/defs/test_defs_is.rb +33 -33
- data/test/defs/test_defs_it.rb +25 -25
- data/test/defs/test_defs_mx.rb +22 -22
- data/test/defs/test_defs_nl.rb +24 -24
- data/test/defs/test_defs_no.rb +29 -0
- data/test/defs/test_defs_north_america.rb +54 -54
- data/test/defs/test_defs_nyse.rb +22 -22
- data/test/defs/test_defs_nz.rb +22 -0
- data/test/defs/test_defs_pt.rb +32 -32
- data/test/defs/test_defs_scandinavia.rb +94 -75
- data/test/defs/test_defs_se.rb +32 -32
- data/test/defs/test_defs_ups.rb +21 -21
- data/test/defs/test_defs_us.rb +23 -23
- data/test/defs/test_defs_za.rb +25 -25
- data/test/test_date.rb +123 -0
- data/test/test_helper.rb +22 -0
- data/test/test_holidays.rb +128 -0
- data/test/test_multiple_regions.rb +24 -0
- metadata +126 -73
data/test/defs/test_defs_au.rb
CHANGED
@@ -1,36 +1,36 @@
|
|
1
|
-
|
2
|
-
require '
|
3
|
-
|
4
|
-
# This file is generated by the Ruby Holiday gem.
|
5
|
-
#
|
6
|
-
# Definitions loaded: data/au.yaml
|
7
|
-
class AuDefinitionTests < Test::Unit::TestCase # :nodoc:
|
8
|
-
|
9
|
-
def test_au
|
10
|
-
{Date.civil(2007,1,1) => 'New Year\'s Day',
|
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',
|
15
|
-
Date.civil(2007,12,25) => 'Christmas Day',
|
16
|
-
Date.civil(2007,12,26) => 'Boxing Day'}.each do |date, name|
|
17
|
-
assert_equal name, Holidays.on(date, :au, :informal)[0][:name]
|
18
|
-
end
|
19
|
-
|
20
|
-
[:au_sa, :au_act, :au_nsw, :au_].each do |r|
|
21
|
-
assert_equal 'Labour Day', Date.civil(2007,10,1).holidays(r)[0][:name]
|
22
|
-
end
|
23
|
-
|
24
|
-
[:au_sa, :au_act, :au_nsw, :au_vic, :au_tas, :au_qld, :au_nt, :au_].each do |r|
|
25
|
-
assert_equal 'Queen\'s Birthday', Date.civil(2007,6,11).holidays(r)[0][:name]
|
26
|
-
end
|
27
|
-
|
28
|
-
assert_equal 'Labour Day', Date.civil(2007,3,5).holidays(:au_wa)[0][:name]
|
29
|
-
assert_equal 'Labour Day', Date.civil(2007,3,12).holidays(:au_vic)[0][:name]
|
30
|
-
assert_equal 'Labour Day', Date.civil(2007,5,7).holidays(:au_qld)[0][:name]
|
31
|
-
|
32
|
-
assert_equal 'May Day', Date.civil(2007,5,7).holidays(:au_nt)[0][:name]
|
33
|
-
|
34
|
-
assert_equal 'Eight Hours Day', Date.civil(2007,3,12).holidays(:au_tas)[0][:name]
|
35
|
-
end
|
36
|
-
end
|
1
|
+
# encoding: utf-8
|
2
|
+
require File.expand_path(File.dirname(__FILE__)) + '/../test_helper'
|
3
|
+
|
4
|
+
# This file is generated by the Ruby Holiday gem.
|
5
|
+
#
|
6
|
+
# Definitions loaded: data/au.yaml
|
7
|
+
class AuDefinitionTests < Test::Unit::TestCase # :nodoc:
|
8
|
+
|
9
|
+
def test_au
|
10
|
+
{Date.civil(2007,1,1) => 'New Year\'s Day',
|
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',
|
15
|
+
Date.civil(2007,12,25) => 'Christmas Day',
|
16
|
+
Date.civil(2007,12,26) => 'Boxing Day'}.each do |date, name|
|
17
|
+
assert_equal name, (Holidays.on(date, :au, :informal)[0] || {})[:name]
|
18
|
+
end
|
19
|
+
|
20
|
+
[:au_sa, :au_act, :au_nsw, :au_].each do |r|
|
21
|
+
assert_equal 'Labour Day', Date.civil(2007,10,1).holidays(r)[0][:name]
|
22
|
+
end
|
23
|
+
|
24
|
+
[:au_sa, :au_act, :au_nsw, :au_vic, :au_tas, :au_qld, :au_nt, :au_].each do |r|
|
25
|
+
assert_equal 'Queen\'s Birthday', Date.civil(2007,6,11).holidays(r)[0][:name]
|
26
|
+
end
|
27
|
+
|
28
|
+
assert_equal 'Labour Day', Date.civil(2007,3,5).holidays(:au_wa)[0][:name]
|
29
|
+
assert_equal 'Labour Day', Date.civil(2007,3,12).holidays(:au_vic)[0][:name]
|
30
|
+
assert_equal 'Labour Day', Date.civil(2007,5,7).holidays(:au_qld)[0][:name]
|
31
|
+
|
32
|
+
assert_equal 'May Day', Date.civil(2007,5,7).holidays(:au_nt)[0][:name]
|
33
|
+
|
34
|
+
assert_equal 'Eight Hours Day', Date.civil(2007,3,12).holidays(:au_tas)[0][:name]
|
35
|
+
end
|
36
|
+
end
|
data/test/defs/test_defs_ca.rb
CHANGED
@@ -1,29 +1,29 @@
|
|
1
|
-
|
2
|
-
require '
|
3
|
-
|
4
|
-
# This file is generated by the Ruby Holiday gem.
|
5
|
-
#
|
6
|
-
# Definitions loaded: data/ca.yaml, data/north_america_informal.yaml
|
7
|
-
class CaDefinitionTests < Test::Unit::TestCase # :nodoc:
|
8
|
-
|
9
|
-
def test_ca
|
10
|
-
{Date.civil(2008,1,1) => 'New Year\'s Day',
|
11
|
-
Date.civil(2008,3,21) => 'Good Friday',
|
12
|
-
Date.civil(2008,3,24) => 'Easter Monday',
|
13
|
-
Date.civil(2008,5,19) => 'Victoria Day',
|
14
|
-
Date.civil(2008,7,1) => 'Canada Day',
|
15
|
-
Date.civil(2008,9,1) => 'Labour Day',
|
16
|
-
Date.civil(2008,10,13) => 'Thanksgiving',
|
17
|
-
Date.civil(2008,11,11) => 'Rememberance Day',
|
18
|
-
Date.civil(2008,12,25) => 'Christmas Day',
|
19
|
-
Date.civil(2008,12,26) => 'Boxing Day'}.each do |date, name|
|
20
|
-
assert_equal name, Holidays.on(date, :ca, :informal)[0][:name]
|
21
|
-
end
|
22
|
-
|
23
|
-
# Victoria Day
|
24
|
-
[Date.civil(2004,5,24), Date.civil(2005,5,23), Date.civil(2006,5,22),
|
25
|
-
Date.civil(2007,5,21), Date.civil(2008,5,19)].each do |date|
|
26
|
-
assert_equal 'Victoria Day', Holidays.on(date, :ca)[0][:name]
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
1
|
+
# encoding: utf-8
|
2
|
+
require File.expand_path(File.dirname(__FILE__)) + '/../test_helper'
|
3
|
+
|
4
|
+
# This file is generated by the Ruby Holiday gem.
|
5
|
+
#
|
6
|
+
# Definitions loaded: data/ca.yaml, data/north_america_informal.yaml
|
7
|
+
class CaDefinitionTests < Test::Unit::TestCase # :nodoc:
|
8
|
+
|
9
|
+
def test_ca
|
10
|
+
{Date.civil(2008,1,1) => 'New Year\'s Day',
|
11
|
+
Date.civil(2008,3,21) => 'Good Friday',
|
12
|
+
Date.civil(2008,3,24) => 'Easter Monday',
|
13
|
+
Date.civil(2008,5,19) => 'Victoria Day',
|
14
|
+
Date.civil(2008,7,1) => 'Canada Day',
|
15
|
+
Date.civil(2008,9,1) => 'Labour Day',
|
16
|
+
Date.civil(2008,10,13) => 'Thanksgiving',
|
17
|
+
Date.civil(2008,11,11) => 'Rememberance Day',
|
18
|
+
Date.civil(2008,12,25) => 'Christmas Day',
|
19
|
+
Date.civil(2008,12,26) => 'Boxing Day'}.each do |date, name|
|
20
|
+
assert_equal name, (Holidays.on(date, :ca, :informal)[0] || {})[:name]
|
21
|
+
end
|
22
|
+
|
23
|
+
# Victoria Day
|
24
|
+
[Date.civil(2004,5,24), Date.civil(2005,5,23), Date.civil(2006,5,22),
|
25
|
+
Date.civil(2007,5,21), Date.civil(2008,5,19)].each do |date|
|
26
|
+
assert_equal 'Victoria Day', Holidays.on(date, :ca)[0][:name]
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
require File.expand_path(File.dirname(__FILE__)) + '/../test_helper'
|
3
|
+
|
4
|
+
# This file is generated by the Ruby Holiday gem.
|
5
|
+
#
|
6
|
+
# Definitions loaded: data/cz.yaml
|
7
|
+
class CzDefinitionTests < Test::Unit::TestCase # :nodoc:
|
8
|
+
|
9
|
+
def test_cz
|
10
|
+
{Date.civil(2010,1,1) => 'Den obnovy samostatného českého státu',
|
11
|
+
Date.civil(2010,4,5) => 'Velikonoční pondělí',
|
12
|
+
Date.civil(2010,5,1) => 'Svátek práce',
|
13
|
+
Date.civil(2010,5,8) => 'Den vítězství',
|
14
|
+
Date.civil(2010,7,5) => 'Den slovanských věrozvěstů Cyrila a Metoděje',
|
15
|
+
Date.civil(2010,7,6) => 'Den upálení mistra Jana Husa',
|
16
|
+
Date.civil(2010,9,28) => 'Den české státnosti',
|
17
|
+
Date.civil(2010,10,28) => 'Den vzniku samostatného československého státu',
|
18
|
+
Date.civil(2010,11,17) => 'Den boje za svobodu a demokracii',
|
19
|
+
Date.civil(2010,12,24) => 'Štědrý den',
|
20
|
+
Date.civil(2010,12,25) => '1. svátek vánoční',
|
21
|
+
Date.civil(2010,12,26) => '2. svátek vánoční'}.each do |date, name|
|
22
|
+
assert_equal name, (Holidays.on(date, :cz, :informal)[0] || {})[:name]
|
23
|
+
end
|
24
|
+
|
25
|
+
end
|
26
|
+
end
|
data/test/defs/test_defs_de.rb
CHANGED
@@ -1,46 +1,51 @@
|
|
1
|
-
|
2
|
-
require '
|
3
|
-
|
4
|
-
# This file is generated by the Ruby Holiday gem.
|
5
|
-
#
|
6
|
-
# Definitions loaded: data/de.yaml
|
7
|
-
class DeDefinitionTests < Test::Unit::TestCase # :nodoc:
|
8
|
-
|
9
|
-
def test_de
|
10
|
-
{Date.civil(2009,1,1) => 'Neujahrstag',
|
11
|
-
Date.civil(2009,4,10) => 'Karfreitag',
|
12
|
-
Date.civil(2009,4,
|
13
|
-
Date.civil(2009,
|
14
|
-
Date.civil(2009,5,
|
15
|
-
Date.civil(2009,
|
16
|
-
Date.civil(2009,
|
17
|
-
Date.civil(2009,
|
18
|
-
Date.civil(2009,12,
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
1
|
+
# encoding: utf-8
|
2
|
+
require File.expand_path(File.dirname(__FILE__)) + '/../test_helper'
|
3
|
+
|
4
|
+
# This file is generated by the Ruby Holiday gem.
|
5
|
+
#
|
6
|
+
# Definitions loaded: data/de.yaml
|
7
|
+
class DeDefinitionTests < Test::Unit::TestCase # :nodoc:
|
8
|
+
|
9
|
+
def test_de
|
10
|
+
{Date.civil(2009,1,1) => 'Neujahrstag',
|
11
|
+
Date.civil(2009,4,10) => 'Karfreitag',
|
12
|
+
Date.civil(2009,4,13) => 'Ostermontag',
|
13
|
+
Date.civil(2009,5,1) => 'Tag der Arbeit',
|
14
|
+
Date.civil(2009,5,21) => 'Christi Himmelfahrt',
|
15
|
+
Date.civil(2009,6,1) => 'Pfingstmontag',
|
16
|
+
Date.civil(2009,10,3) => 'Tag der Deutschen Einheit',
|
17
|
+
Date.civil(2009,12,25) => '1. Weihnachtstag',
|
18
|
+
Date.civil(2009,12,26) => '2. Weihnachtstag'}.each do |date, name|
|
19
|
+
assert_equal name, (Holidays.on(date, :de, :informal)[0] || {})[:name]
|
20
|
+
end
|
21
|
+
|
22
|
+
[:de_bw, :de_by, :de_st, :de_].each do |r|
|
23
|
+
assert_equal 'Heilige Drei Könige', Date.civil(2009,1,6).holidays(r)[0][:name]
|
24
|
+
end
|
25
|
+
|
26
|
+
[:de_bw, :de_by, :de_he, :de_nw, :de_rp, :de_sl, :de_].each do |r|
|
27
|
+
assert_equal 'Fronleichnam', Date.civil(2009,6,11).holidays(r)[0][:name]
|
28
|
+
end
|
29
|
+
|
30
|
+
[:de_by, :de_sl, :de_].each do |r|
|
31
|
+
assert_equal 'Mariä Himmelfahrt', Date.civil(2009,8,15).holidays(r)[0][:name]
|
32
|
+
end
|
33
|
+
|
34
|
+
[:de_bb, :de_mv, :de_sn, :de_st, :de_th, :de_].each do |r|
|
35
|
+
assert_equal 'Reformationstag', Date.civil(2009,10,31).holidays(r)[0][:name]
|
36
|
+
end
|
37
|
+
|
38
|
+
[:de_bw, :de_by, :de_nw, :de_rp, :de_sl, :de_].each do |r|
|
39
|
+
assert_equal 'Allerheiligen', Date.civil(2009,11,1).holidays(r)[0][:name]
|
40
|
+
end
|
41
|
+
|
42
|
+
assert !Date.civil(2010,5,8).holiday?(:de), '2010-05-08 is not a holiday in Germany'
|
43
|
+
|
44
|
+
# Repentance Day
|
45
|
+
assert_equal 'Buß- und Bettag', Date.civil(2004,11,17).holidays(:de_sn)[0][:name]
|
46
|
+
assert_equal 'Buß- und Bettag', Date.civil(2005,11,16).holidays(:de_sn)[0][:name]
|
47
|
+
assert_equal 'Buß- und Bettag', Date.civil(2006,11,22).holidays(:de_sn)[0][:name]
|
48
|
+
assert_equal 'Buß- und Bettag', Date.civil(2009,11,18).holidays(:de_sn)[0][:name]
|
49
|
+
|
50
|
+
end
|
51
|
+
end
|
data/test/defs/test_defs_dk.rb
CHANGED
@@ -1,30 +1,30 @@
|
|
1
|
-
|
2
|
-
require '
|
3
|
-
|
4
|
-
# This file is generated by the Ruby Holiday gem.
|
5
|
-
#
|
6
|
-
# Definitions loaded: data/dk.yaml
|
7
|
-
class DkDefinitionTests < Test::Unit::TestCase # :nodoc:
|
8
|
-
|
9
|
-
def test_dk
|
10
|
-
{Date.civil(2007,1,1) => 'Nytårsdag',
|
11
|
-
Date.civil(2007,2,18) => 'Fastelavn',
|
12
|
-
Date.civil(2007,4,9) => 'Danmarks besættelse',
|
13
|
-
Date.civil(2007,4,16) => 'Dronningens fødselsdag',
|
14
|
-
Date.civil(2007,4,5) => 'Skærtorsdag',
|
15
|
-
Date.civil(2007,4,6) => 'Langfredag',
|
16
|
-
Date.civil(2007,4,8) => 'Påskedag',
|
17
|
-
Date.civil(2007,4,9) => '2. påskedag',
|
18
|
-
Date.civil(2007,5,1) => 'Arbejdernes kampdag',
|
19
|
-
Date.civil(2007,5,4) => 'Store Bededag',
|
20
|
-
Date.civil(2007,5,17) => 'Kristi Himmelfartsdag',
|
21
|
-
Date.civil(2007,5,27) => 'Pinsedag',
|
22
|
-
Date.civil(2007,5,28) => '2. Pinsedag',
|
23
|
-
Date.civil(2007,6,5) => 'Grundlovsdag',
|
24
|
-
Date.civil(2007,12,24) => 'Juleaftensdag',
|
25
|
-
Date.civil(2007,12,25) => '1. juledag',
|
26
|
-
Date.civil(2007,12,26) => '2. juledag'}.each do |date, name|
|
27
|
-
assert_equal name, Holidays.on(date, :dk, :informal)[0][:name]
|
28
|
-
end
|
29
|
-
end
|
30
|
-
end
|
1
|
+
# encoding: utf-8
|
2
|
+
require File.expand_path(File.dirname(__FILE__)) + '/../test_helper'
|
3
|
+
|
4
|
+
# This file is generated by the Ruby Holiday gem.
|
5
|
+
#
|
6
|
+
# Definitions loaded: data/dk.yaml
|
7
|
+
class DkDefinitionTests < Test::Unit::TestCase # :nodoc:
|
8
|
+
|
9
|
+
def test_dk
|
10
|
+
{Date.civil(2007,1,1) => 'Nytårsdag',
|
11
|
+
Date.civil(2007,2,18) => 'Fastelavn',
|
12
|
+
Date.civil(2007,4,9) => 'Danmarks besættelse',
|
13
|
+
Date.civil(2007,4,16) => 'Dronningens fødselsdag',
|
14
|
+
Date.civil(2007,4,5) => 'Skærtorsdag',
|
15
|
+
Date.civil(2007,4,6) => 'Langfredag',
|
16
|
+
Date.civil(2007,4,8) => 'Påskedag',
|
17
|
+
Date.civil(2007,4,9) => '2. påskedag',
|
18
|
+
Date.civil(2007,5,1) => 'Arbejdernes kampdag',
|
19
|
+
Date.civil(2007,5,4) => 'Store Bededag',
|
20
|
+
Date.civil(2007,5,17) => 'Kristi Himmelfartsdag',
|
21
|
+
Date.civil(2007,5,27) => 'Pinsedag',
|
22
|
+
Date.civil(2007,5,28) => '2. Pinsedag',
|
23
|
+
Date.civil(2007,6,5) => 'Grundlovsdag',
|
24
|
+
Date.civil(2007,12,24) => 'Juleaftensdag',
|
25
|
+
Date.civil(2007,12,25) => '1. juledag',
|
26
|
+
Date.civil(2007,12,26) => '2. juledag'}.each do |date, name|
|
27
|
+
assert_equal name, (Holidays.on(date, :dk, :informal)[0] || {})[:name]
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
data/test/defs/test_defs_es.rb
CHANGED
@@ -1,57 +1,57 @@
|
|
1
|
-
|
2
|
-
require '
|
3
|
-
|
4
|
-
# This file is generated by the Ruby Holiday gem.
|
5
|
-
#
|
6
|
-
# Definitions loaded: data/es.yaml
|
7
|
-
class EsDefinitionTests < Test::Unit::TestCase # :nodoc:
|
8
|
-
|
9
|
-
def test_es
|
10
|
-
{Date.civil(2009,1,1) => 'Año Nuevo',
|
11
|
-
Date.civil(2009,1,6) => 'Día de Reyes',
|
12
|
-
Date.civil(2009,4,10) => 'Viernes Santo',
|
13
|
-
Date.civil(2009,5,1) => 'Día del Trabajador',
|
14
|
-
Date.civil(2009,8,15) => 'Asunción',
|
15
|
-
Date.civil(2009,10,12) => 'Día de la Hispanidad',
|
16
|
-
Date.civil(2009,11,1) => 'Todos los Santos',
|
17
|
-
Date.civil(2009,12,6) => 'Día de la Constitución',
|
18
|
-
Date.civil(2009,12,8) => 'Inmaculada Concepción',
|
19
|
-
Date.civil(2009,12,25) => 'Navidad del Señor'}.each do |date, name|
|
20
|
-
assert_equal name, Holidays.on(date, :es, :informal)[0][:name]
|
21
|
-
end
|
22
|
-
|
23
|
-
[:es_pv, :es_ct, :es_na, :es_v, :es_vc, :es_].each do |r|
|
24
|
-
assert_equal 'Jueves Santo', Date.civil(2009,4,9).holidays(r)[0][:name]
|
25
|
-
assert_equal 'Lunes de Pascua', Date.civil(2009,4,13).holidays(r)[0][:name]
|
26
|
-
end
|
27
|
-
|
28
|
-
[:es_v, :es_vc, :es_cm, :es_mu, :es_m, :es_].each do |r|
|
29
|
-
assert_equal 'San José', Date.civil(2009,3,19).holidays(r)[0][:name]
|
30
|
-
end
|
31
|
-
|
32
|
-
[:es_ar, :es_cl, :es_].each do |r|
|
33
|
-
assert_equal 'San Jorge', Date.civil(2009,4,23).holidays(r)[0][:name]
|
34
|
-
end
|
35
|
-
|
36
|
-
[:es_vc, :es_v, :es_].each do |r|
|
37
|
-
assert_equal 'Día de Valencia', Date.civil(2009,10,9).holidays(r)[0][:name]
|
38
|
-
end
|
39
|
-
|
40
|
-
[:es_ib, :es_ct, :es_].each do |r|
|
41
|
-
assert_equal 'San Esteban', Date.civil(2009,12,26).holidays(r)[0][:name]
|
42
|
-
end
|
43
|
-
|
44
|
-
assert_equal 'Día de Andalucía', Date.civil(2009,2,28).holidays(:es_an)[0][:name]
|
45
|
-
assert_equal 'Día de las Islas Baleares', Date.civil(2009,3,1).holidays(:es_ib)[0][:name]
|
46
|
-
assert_equal 'Fiesta de la Comunidad', Date.civil(2006,5,2).holidays(:es_m)[0][:name]
|
47
|
-
assert_equal 'Día de las Canarias', Date.civil(2006,5,30).holidays(:es_cn)[0][:name]
|
48
|
-
assert_equal 'Día de la Región Castilla-La Mancha', Date.civil(2009,5,31).holidays(:es_cm)[0][:name]
|
49
|
-
assert_equal 'Día de la Región de Murcia', Date.civil(2009,6,9).holidays(:es_mu)[0][:name]
|
50
|
-
assert_equal 'Día de La Rioja', Date.civil(2009,6,9).holidays(:es_lo)[0][:name]
|
51
|
-
assert_equal 'Santiago Apostol', Date.civil(2009,7,23).holidays(:es_ga)[0][:name]
|
52
|
-
assert_equal 'Día de Ceuta', Date.civil(2009,9,2).holidays(:es_ce)[0][:name]
|
53
|
-
assert_equal 'Día de Asturias', Date.civil(2009,9,8).holidays(:es_o)[0][:name]
|
54
|
-
assert_equal 'Día de Extremadura', Date.civil(2009,9,8).holidays(:es_ex)[0][:name]
|
55
|
-
assert_equal 'Fiesta Nacional de Cataluña', Date.civil(2009,9,11).holidays(:es_ct)[0][:name]
|
56
|
-
end
|
57
|
-
end
|
1
|
+
# encoding: utf-8
|
2
|
+
require File.expand_path(File.dirname(__FILE__)) + '/../test_helper'
|
3
|
+
|
4
|
+
# This file is generated by the Ruby Holiday gem.
|
5
|
+
#
|
6
|
+
# Definitions loaded: data/es.yaml
|
7
|
+
class EsDefinitionTests < Test::Unit::TestCase # :nodoc:
|
8
|
+
|
9
|
+
def test_es
|
10
|
+
{Date.civil(2009,1,1) => 'Año Nuevo',
|
11
|
+
Date.civil(2009,1,6) => 'Día de Reyes',
|
12
|
+
Date.civil(2009,4,10) => 'Viernes Santo',
|
13
|
+
Date.civil(2009,5,1) => 'Día del Trabajador',
|
14
|
+
Date.civil(2009,8,15) => 'Asunción',
|
15
|
+
Date.civil(2009,10,12) => 'Día de la Hispanidad',
|
16
|
+
Date.civil(2009,11,1) => 'Todos los Santos',
|
17
|
+
Date.civil(2009,12,6) => 'Día de la Constitución',
|
18
|
+
Date.civil(2009,12,8) => 'Inmaculada Concepción',
|
19
|
+
Date.civil(2009,12,25) => 'Navidad del Señor'}.each do |date, name|
|
20
|
+
assert_equal name, (Holidays.on(date, :es, :informal)[0] || {})[:name]
|
21
|
+
end
|
22
|
+
|
23
|
+
[:es_pv, :es_ct, :es_na, :es_v, :es_vc, :es_].each do |r|
|
24
|
+
assert_equal 'Jueves Santo', Date.civil(2009,4,9).holidays(r)[0][:name]
|
25
|
+
assert_equal 'Lunes de Pascua', Date.civil(2009,4,13).holidays(r)[0][:name]
|
26
|
+
end
|
27
|
+
|
28
|
+
[:es_v, :es_vc, :es_cm, :es_mu, :es_m, :es_].each do |r|
|
29
|
+
assert_equal 'San José', Date.civil(2009,3,19).holidays(r)[0][:name]
|
30
|
+
end
|
31
|
+
|
32
|
+
[:es_ar, :es_cl, :es_].each do |r|
|
33
|
+
assert_equal 'San Jorge', Date.civil(2009,4,23).holidays(r)[0][:name]
|
34
|
+
end
|
35
|
+
|
36
|
+
[:es_vc, :es_v, :es_].each do |r|
|
37
|
+
assert_equal 'Día de Valencia', Date.civil(2009,10,9).holidays(r)[0][:name]
|
38
|
+
end
|
39
|
+
|
40
|
+
[:es_ib, :es_ct, :es_].each do |r|
|
41
|
+
assert_equal 'San Esteban', Date.civil(2009,12,26).holidays(r)[0][:name]
|
42
|
+
end
|
43
|
+
|
44
|
+
assert_equal 'Día de Andalucía', Date.civil(2009,2,28).holidays(:es_an)[0][:name]
|
45
|
+
assert_equal 'Día de las Islas Baleares', Date.civil(2009,3,1).holidays(:es_ib)[0][:name]
|
46
|
+
assert_equal 'Fiesta de la Comunidad', Date.civil(2006,5,2).holidays(:es_m)[0][:name]
|
47
|
+
assert_equal 'Día de las Canarias', Date.civil(2006,5,30).holidays(:es_cn)[0][:name]
|
48
|
+
assert_equal 'Día de la Región Castilla-La Mancha', Date.civil(2009,5,31).holidays(:es_cm)[0][:name]
|
49
|
+
assert_equal 'Día de la Región de Murcia', Date.civil(2009,6,9).holidays(:es_mu)[0][:name]
|
50
|
+
assert_equal 'Día de La Rioja', Date.civil(2009,6,9).holidays(:es_lo)[0][:name]
|
51
|
+
assert_equal 'Santiago Apostol', Date.civil(2009,7,23).holidays(:es_ga)[0][:name]
|
52
|
+
assert_equal 'Día de Ceuta', Date.civil(2009,9,2).holidays(:es_ce)[0][:name]
|
53
|
+
assert_equal 'Día de Asturias', Date.civil(2009,9,8).holidays(:es_o)[0][:name]
|
54
|
+
assert_equal 'Día de Extremadura', Date.civil(2009,9,8).holidays(:es_ex)[0][:name]
|
55
|
+
assert_equal 'Fiesta Nacional de Cataluña', Date.civil(2009,9,11).holidays(:es_ct)[0][:name]
|
56
|
+
end
|
57
|
+
end
|
@@ -1,240 +1,280 @@
|
|
1
|
-
|
2
|
-
require '
|
3
|
-
|
4
|
-
# This file is generated by the Ruby Holiday gem.
|
5
|
-
#
|
6
|
-
# Definitions loaded: data/dk.yaml, data/de.yaml, data/es.yaml, data/fr.yaml, data/gb.yaml, data/ie.yaml, data/is.yaml, data/it.yaml, data/nl.yaml, data/pt.yaml
|
7
|
-
class EuropeDefinitionTests < Test::Unit::TestCase # :nodoc:
|
8
|
-
|
9
|
-
def test_europe
|
10
|
-
{Date.civil(
|
11
|
-
Date.civil(
|
12
|
-
Date.civil(
|
13
|
-
Date.civil(
|
14
|
-
Date.civil(
|
15
|
-
Date.civil(
|
16
|
-
Date.civil(
|
17
|
-
Date.civil(
|
18
|
-
Date.civil(
|
19
|
-
Date.civil(
|
20
|
-
Date.civil(
|
21
|
-
Date.civil(
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
Date.civil(
|
32
|
-
Date.civil(
|
33
|
-
Date.civil(
|
34
|
-
Date.civil(
|
35
|
-
Date.civil(
|
36
|
-
Date.civil(
|
37
|
-
Date.civil(
|
38
|
-
Date.civil(
|
39
|
-
Date.civil(
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
assert_equal '
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
Date.civil(2009,
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
Date.civil(2009,10,
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
Date.civil(2009,
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
assert_equal
|
98
|
-
end
|
99
|
-
|
100
|
-
|
101
|
-
assert_equal '
|
102
|
-
assert_equal '
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
assert_equal '
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
assert_equal '
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
Date.civil(
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
Date.civil(
|
119
|
-
|
120
|
-
|
121
|
-
Date.civil(
|
122
|
-
Date.civil(
|
123
|
-
Date.civil(
|
124
|
-
Date.civil(
|
125
|
-
Date.civil(
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
Date.civil(
|
131
|
-
Date.civil(
|
132
|
-
Date.civil(
|
133
|
-
|
134
|
-
|
135
|
-
Date.civil(
|
136
|
-
Date.civil(
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
assert_equal
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
Date.civil(2008,
|
157
|
-
Date.civil(2008,
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
Date.civil(2008,
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
Date.civil(
|
168
|
-
Date.civil(
|
169
|
-
Date.civil(
|
170
|
-
|
171
|
-
|
172
|
-
Date.civil(
|
173
|
-
Date.civil(
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
Date.civil(
|
178
|
-
Date.civil(
|
179
|
-
Date.civil(
|
180
|
-
Date.civil(
|
181
|
-
Date.civil(
|
182
|
-
Date.civil(
|
183
|
-
Date.civil(
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
Date.civil(2007,
|
191
|
-
Date.civil(2007,4,
|
192
|
-
Date.civil(2007,4,
|
193
|
-
Date.civil(2007,4,
|
194
|
-
Date.civil(2007,
|
195
|
-
Date.civil(2007,
|
196
|
-
Date.civil(2007,
|
197
|
-
Date.civil(2007,
|
198
|
-
Date.civil(2007,
|
199
|
-
Date.civil(2007,
|
200
|
-
Date.civil(2007,
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
Date.civil(
|
206
|
-
Date.civil(
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
Date.civil(
|
212
|
-
Date.civil(
|
213
|
-
Date.civil(
|
214
|
-
Date.civil(
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
Date.civil(
|
220
|
-
Date.civil(
|
221
|
-
Date.civil(2007,
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
Date.civil(2008,
|
227
|
-
Date.civil(
|
228
|
-
Date.civil(
|
229
|
-
Date.civil(2008,
|
230
|
-
Date.civil(2008,
|
231
|
-
Date.civil(2008,
|
232
|
-
Date.civil(2008,
|
233
|
-
Date.civil(2008,
|
234
|
-
Date.civil(2008,12,
|
235
|
-
Date.civil(2008,12,
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
1
|
+
# encoding: utf-8
|
2
|
+
require File.expand_path(File.dirname(__FILE__)) + '/../test_helper'
|
3
|
+
|
4
|
+
# This file is generated by the Ruby Holiday gem.
|
5
|
+
#
|
6
|
+
# Definitions loaded: data/cz.yaml, data/dk.yaml, data/de.yaml, data/es.yaml, data/fr.yaml, data/gb.yaml, data/ie.yaml, data/is.yaml, data/it.yaml, data/nl.yaml, data/no.yaml, data/pt.yaml
|
7
|
+
class EuropeDefinitionTests < Test::Unit::TestCase # :nodoc:
|
8
|
+
|
9
|
+
def test_europe
|
10
|
+
{Date.civil(2010,1,1) => 'Den obnovy samostatného českého státu',
|
11
|
+
Date.civil(2010,4,5) => 'Velikonoční pondělí',
|
12
|
+
Date.civil(2010,5,1) => 'Svátek práce',
|
13
|
+
Date.civil(2010,5,8) => 'Den vítězství',
|
14
|
+
Date.civil(2010,7,5) => 'Den slovanských věrozvěstů Cyrila a Metoděje',
|
15
|
+
Date.civil(2010,7,6) => 'Den upálení mistra Jana Husa',
|
16
|
+
Date.civil(2010,9,28) => 'Den české státnosti',
|
17
|
+
Date.civil(2010,10,28) => 'Den vzniku samostatného československého státu',
|
18
|
+
Date.civil(2010,11,17) => 'Den boje za svobodu a demokracii',
|
19
|
+
Date.civil(2010,12,24) => 'Štědrý den',
|
20
|
+
Date.civil(2010,12,25) => '1. svátek vánoční',
|
21
|
+
Date.civil(2010,12,26) => '2. svátek vánoční'}.each do |date, name|
|
22
|
+
assert_equal name, (Holidays.on(date, :cz, :informal)[0] || {})[:name]
|
23
|
+
end
|
24
|
+
|
25
|
+
|
26
|
+
{Date.civil(2007,1,1) => 'Nytårsdag',
|
27
|
+
Date.civil(2007,2,18) => 'Fastelavn',
|
28
|
+
Date.civil(2007,4,9) => 'Danmarks besættelse',
|
29
|
+
Date.civil(2007,4,16) => 'Dronningens fødselsdag',
|
30
|
+
Date.civil(2007,4,5) => 'Skærtorsdag',
|
31
|
+
Date.civil(2007,4,6) => 'Langfredag',
|
32
|
+
Date.civil(2007,4,8) => 'Påskedag',
|
33
|
+
Date.civil(2007,4,9) => '2. påskedag',
|
34
|
+
Date.civil(2007,5,1) => 'Arbejdernes kampdag',
|
35
|
+
Date.civil(2007,5,4) => 'Store Bededag',
|
36
|
+
Date.civil(2007,5,17) => 'Kristi Himmelfartsdag',
|
37
|
+
Date.civil(2007,5,27) => 'Pinsedag',
|
38
|
+
Date.civil(2007,5,28) => '2. Pinsedag',
|
39
|
+
Date.civil(2007,6,5) => 'Grundlovsdag',
|
40
|
+
Date.civil(2007,12,24) => 'Juleaftensdag',
|
41
|
+
Date.civil(2007,12,25) => '1. juledag',
|
42
|
+
Date.civil(2007,12,26) => '2. juledag'}.each do |date, name|
|
43
|
+
assert_equal name, (Holidays.on(date, :dk, :informal)[0] || {})[:name]
|
44
|
+
end
|
45
|
+
|
46
|
+
{Date.civil(2009,1,1) => 'Neujahrstag',
|
47
|
+
Date.civil(2009,4,10) => 'Karfreitag',
|
48
|
+
Date.civil(2009,4,13) => 'Ostermontag',
|
49
|
+
Date.civil(2009,5,1) => 'Tag der Arbeit',
|
50
|
+
Date.civil(2009,5,21) => 'Christi Himmelfahrt',
|
51
|
+
Date.civil(2009,6,1) => 'Pfingstmontag',
|
52
|
+
Date.civil(2009,10,3) => 'Tag der Deutschen Einheit',
|
53
|
+
Date.civil(2009,12,25) => '1. Weihnachtstag',
|
54
|
+
Date.civil(2009,12,26) => '2. Weihnachtstag'}.each do |date, name|
|
55
|
+
assert_equal name, (Holidays.on(date, :de, :informal)[0] || {})[:name]
|
56
|
+
end
|
57
|
+
|
58
|
+
[:de_bw, :de_by, :de_st, :de_].each do |r|
|
59
|
+
assert_equal 'Heilige Drei Könige', Date.civil(2009,1,6).holidays(r)[0][:name]
|
60
|
+
end
|
61
|
+
|
62
|
+
[:de_bw, :de_by, :de_he, :de_nw, :de_rp, :de_sl, :de_].each do |r|
|
63
|
+
assert_equal 'Fronleichnam', Date.civil(2009,6,11).holidays(r)[0][:name]
|
64
|
+
end
|
65
|
+
|
66
|
+
[:de_by, :de_sl, :de_].each do |r|
|
67
|
+
assert_equal 'Mariä Himmelfahrt', Date.civil(2009,8,15).holidays(r)[0][:name]
|
68
|
+
end
|
69
|
+
|
70
|
+
[:de_bb, :de_mv, :de_sn, :de_st, :de_th, :de_].each do |r|
|
71
|
+
assert_equal 'Reformationstag', Date.civil(2009,10,31).holidays(r)[0][:name]
|
72
|
+
end
|
73
|
+
|
74
|
+
[:de_bw, :de_by, :de_nw, :de_rp, :de_sl, :de_].each do |r|
|
75
|
+
assert_equal 'Allerheiligen', Date.civil(2009,11,1).holidays(r)[0][:name]
|
76
|
+
end
|
77
|
+
|
78
|
+
assert !Date.civil(2010,5,8).holiday?(:de), '2010-05-08 is not a holiday in Germany'
|
79
|
+
|
80
|
+
# Repentance Day
|
81
|
+
assert_equal 'Buß- und Bettag', Date.civil(2004,11,17).holidays(:de_sn)[0][:name]
|
82
|
+
assert_equal 'Buß- und Bettag', Date.civil(2005,11,16).holidays(:de_sn)[0][:name]
|
83
|
+
assert_equal 'Buß- und Bettag', Date.civil(2006,11,22).holidays(:de_sn)[0][:name]
|
84
|
+
assert_equal 'Buß- und Bettag', Date.civil(2009,11,18).holidays(:de_sn)[0][:name]
|
85
|
+
|
86
|
+
|
87
|
+
{Date.civil(2009,1,1) => 'Año Nuevo',
|
88
|
+
Date.civil(2009,1,6) => 'Día de Reyes',
|
89
|
+
Date.civil(2009,4,10) => 'Viernes Santo',
|
90
|
+
Date.civil(2009,5,1) => 'Día del Trabajador',
|
91
|
+
Date.civil(2009,8,15) => 'Asunción',
|
92
|
+
Date.civil(2009,10,12) => 'Día de la Hispanidad',
|
93
|
+
Date.civil(2009,11,1) => 'Todos los Santos',
|
94
|
+
Date.civil(2009,12,6) => 'Día de la Constitución',
|
95
|
+
Date.civil(2009,12,8) => 'Inmaculada Concepción',
|
96
|
+
Date.civil(2009,12,25) => 'Navidad del Señor'}.each do |date, name|
|
97
|
+
assert_equal name, (Holidays.on(date, :es, :informal)[0] || {})[:name]
|
98
|
+
end
|
99
|
+
|
100
|
+
[:es_pv, :es_ct, :es_na, :es_v, :es_vc, :es_].each do |r|
|
101
|
+
assert_equal 'Jueves Santo', Date.civil(2009,4,9).holidays(r)[0][:name]
|
102
|
+
assert_equal 'Lunes de Pascua', Date.civil(2009,4,13).holidays(r)[0][:name]
|
103
|
+
end
|
104
|
+
|
105
|
+
[:es_v, :es_vc, :es_cm, :es_mu, :es_m, :es_].each do |r|
|
106
|
+
assert_equal 'San José', Date.civil(2009,3,19).holidays(r)[0][:name]
|
107
|
+
end
|
108
|
+
|
109
|
+
[:es_ar, :es_cl, :es_].each do |r|
|
110
|
+
assert_equal 'San Jorge', Date.civil(2009,4,23).holidays(r)[0][:name]
|
111
|
+
end
|
112
|
+
|
113
|
+
[:es_vc, :es_v, :es_].each do |r|
|
114
|
+
assert_equal 'Día de Valencia', Date.civil(2009,10,9).holidays(r)[0][:name]
|
115
|
+
end
|
116
|
+
|
117
|
+
[:es_ib, :es_ct, :es_].each do |r|
|
118
|
+
assert_equal 'San Esteban', Date.civil(2009,12,26).holidays(r)[0][:name]
|
119
|
+
end
|
120
|
+
|
121
|
+
assert_equal 'Día de Andalucía', Date.civil(2009,2,28).holidays(:es_an)[0][:name]
|
122
|
+
assert_equal 'Día de las Islas Baleares', Date.civil(2009,3,1).holidays(:es_ib)[0][:name]
|
123
|
+
assert_equal 'Fiesta de la Comunidad', Date.civil(2006,5,2).holidays(:es_m)[0][:name]
|
124
|
+
assert_equal 'Día de las Canarias', Date.civil(2006,5,30).holidays(:es_cn)[0][:name]
|
125
|
+
assert_equal 'Día de la Región Castilla-La Mancha', Date.civil(2009,5,31).holidays(:es_cm)[0][:name]
|
126
|
+
assert_equal 'Día de la Región de Murcia', Date.civil(2009,6,9).holidays(:es_mu)[0][:name]
|
127
|
+
assert_equal 'Día de La Rioja', Date.civil(2009,6,9).holidays(:es_lo)[0][:name]
|
128
|
+
assert_equal 'Santiago Apostol', Date.civil(2009,7,23).holidays(:es_ga)[0][:name]
|
129
|
+
assert_equal 'Día de Ceuta', Date.civil(2009,9,2).holidays(:es_ce)[0][:name]
|
130
|
+
assert_equal 'Día de Asturias', Date.civil(2009,9,8).holidays(:es_o)[0][:name]
|
131
|
+
assert_equal 'Día de Extremadura', Date.civil(2009,9,8).holidays(:es_ex)[0][:name]
|
132
|
+
assert_equal 'Fiesta Nacional de Cataluña', Date.civil(2009,9,11).holidays(:es_ct)[0][:name]
|
133
|
+
|
134
|
+
{Date.civil(2007,1,1) => 'Jour de l\'an',
|
135
|
+
Date.civil(2007,4,8) => 'Pâques',
|
136
|
+
Date.civil(2007,4,9) => 'Lundi de Pâques',
|
137
|
+
Date.civil(2007,5,1) => 'Fête du travail',
|
138
|
+
Date.civil(2007,5,8) => 'Victoire 1945',
|
139
|
+
Date.civil(2007,5,17) => 'Ascension',
|
140
|
+
Date.civil(2007,5,27) => 'Pentecôte',
|
141
|
+
Date.civil(2007,5,28) => 'Lundi de Pentecôte',
|
142
|
+
Date.civil(2007,7,14) => 'Fête nationale',
|
143
|
+
Date.civil(2007,8,15) => 'Assomption',
|
144
|
+
Date.civil(2007,11,1) => 'Toussaint',
|
145
|
+
Date.civil(2007,11,11) => 'Armistice 1918',
|
146
|
+
Date.civil(2007,12,25) => 'Nöel'}.each do |date, name|
|
147
|
+
assert_equal name, (Holidays.on(date, :fr, :informal)[0] || {})[:name]
|
148
|
+
end
|
149
|
+
|
150
|
+
{Date.civil(2008,1,1) => 'New Year\'s Day',
|
151
|
+
Date.civil(2008,3,21) => 'Good Friday',
|
152
|
+
Date.civil(2008,3,23) => 'Easter Sunday',
|
153
|
+
Date.civil(2008,5,5) => 'May Day',
|
154
|
+
Date.civil(2008,5,26) => 'Bank Holiday',
|
155
|
+
Date.civil(2008,11,5) => 'Guy Fawkes Day',
|
156
|
+
Date.civil(2008,12,25) => 'Christmas Day',
|
157
|
+
Date.civil(2008,12,26) => 'Boxing Day'}.each do |date, name|
|
158
|
+
assert_equal name, (Holidays.on(date, :gb, :informal)[0] || {})[:name]
|
159
|
+
end
|
160
|
+
|
161
|
+
assert_equal 'St. Patrick\'s Day', Date.civil(2008,3,17).holidays(:gb_nir, :informal)[0][:name]
|
162
|
+
|
163
|
+
assert_equal 'Christmas Day', Date.civil(2008,12,25).holidays(:gb_, :observed)[0][:name]
|
164
|
+
assert_equal 'Christmas Day', Date.civil(2009,12,25).holidays(:gb_, :observed)[0][:name]
|
165
|
+
assert_equal 'Christmas Day', Date.civil(2010,12,27).holidays(:gb_, :observed)[0][:name]
|
166
|
+
|
167
|
+
assert_equal 'Boxing Day', Date.civil(2008,12,26).holidays(:gb_, :observed)[0][:name]
|
168
|
+
assert_equal 'Boxing Day', Date.civil(2009,12,28).holidays(:gb_, :observed)[0][:name]
|
169
|
+
assert_equal 'Boxing Day', Date.civil(2010,12,28).holidays(:gb_, :observed)[0][:name]
|
170
|
+
|
171
|
+
[:gb_wls, :gb_eng, :gb_nir, :gb_eaw, :gb_].each do |r|
|
172
|
+
assert_equal 'Easter Monday', Date.civil(2008,3,24).holidays(r)[0][:name]
|
173
|
+
assert_equal 'Bank Holiday', Date.civil(2008,8,25).holidays(r)[0][:name]
|
174
|
+
end
|
175
|
+
|
176
|
+
{Date.civil(2008,1,1) => 'New Year\'s Day',
|
177
|
+
Date.civil(2008,3,17) => 'St. Patrick\'s Day',
|
178
|
+
Date.civil(2008,3,24) => 'Easter Monday',
|
179
|
+
Date.civil(2008,5,5) => 'May Day',
|
180
|
+
Date.civil(2008,6,2) => 'Bank Holiday',
|
181
|
+
Date.civil(2008,8,4) => 'Bank Holiday',
|
182
|
+
Date.civil(2008,12,25) => 'Christmas Day',
|
183
|
+
Date.civil(2008,12,26) => 'St. Stephen\'s Day'}.each do |date, name|
|
184
|
+
assert_equal name, (Holidays.on(date, :ie, :informal)[0] || {})[:name]
|
185
|
+
end
|
186
|
+
|
187
|
+
{Date.civil(2007,1,1) => 'Nýársdagur',
|
188
|
+
Date.civil(2007,1,6) => 'Þrettándinn',
|
189
|
+
Date.civil(2007,1,19) => 'Bóndadagur',
|
190
|
+
Date.civil(2007,2,18) => 'Konudagur',
|
191
|
+
Date.civil(2007,4,5) => 'Skírdagur',
|
192
|
+
Date.civil(2007,4,6) => 'Föstudaginn langi',
|
193
|
+
Date.civil(2007,4,8) => 'Páskadagur',
|
194
|
+
Date.civil(2007,4,9) => 'Annar í páskum',
|
195
|
+
Date.civil(2007,4,19) => 'Sumardagurinn fyrsti',
|
196
|
+
Date.civil(2007,5,1) => 'Verkalýðsdagurinn',
|
197
|
+
Date.civil(2007,5,17) => 'Uppstigningardagur',
|
198
|
+
Date.civil(2007,5,27) => 'Hvítasunnudagur',
|
199
|
+
Date.civil(2007,5,28) => 'Annar í hvítasunnu',
|
200
|
+
Date.civil(2007,6,3) => 'Sjómannadagurinn',
|
201
|
+
Date.civil(2007,6,17) => 'Lýðveldisdagurinn',
|
202
|
+
Date.civil(2007,8,6) => 'Frídagur verslunarmanna',
|
203
|
+
Date.civil(2007,12,24) => 'Jól',
|
204
|
+
Date.civil(2007,12,25) => 'Jól',
|
205
|
+
Date.civil(2007,12,26) => 'Jól',
|
206
|
+
Date.civil(2007,12,31) => 'Gamlárskvöld'}.each do |date, name|
|
207
|
+
assert_equal name, (Holidays.on(date, :is, :informal)[0] || {})[:name]
|
208
|
+
end
|
209
|
+
|
210
|
+
{Date.civil(2007,1,1) => 'Capodanno',
|
211
|
+
Date.civil(2007,1,6) => 'Epifania',
|
212
|
+
Date.civil(2007,4,8) => 'Pasqua',
|
213
|
+
Date.civil(2007,4,9) => 'Lunedì dell\'Angelo',
|
214
|
+
Date.civil(2007,4,25) => 'Festa della Liberazione',
|
215
|
+
Date.civil(2007,5,1) => 'Festa dei Lavoratori',
|
216
|
+
Date.civil(2007,6,2) => 'Festa della Repubblica',
|
217
|
+
Date.civil(2007,8,15) => 'Assunzione',
|
218
|
+
Date.civil(2007,11,1) => 'Ognissanti',
|
219
|
+
Date.civil(2007,12,8) => 'Immacolata Concezione',
|
220
|
+
Date.civil(2007,12,25) => 'Natale',
|
221
|
+
Date.civil(2007,12,26) => 'Santo Stefano'}.each do |date, name|
|
222
|
+
assert_equal name, (Holidays.on(date, :it, :informal)[0] || {})[:name]
|
223
|
+
end
|
224
|
+
|
225
|
+
{Date.civil(2008,1,1) => 'Nieuwjaar',
|
226
|
+
Date.civil(2008,3,21) => 'Goede Vrijdag',
|
227
|
+
Date.civil(2008,3,23) => 'Pasen',
|
228
|
+
Date.civil(2008,3,24) => 'Pasen',
|
229
|
+
Date.civil(2008,4,30) => 'Koninginnedag',
|
230
|
+
Date.civil(2008,5,1) => 'Hemelvaartsdag', # Ascension, Easter+39
|
231
|
+
Date.civil(2008,5,5) => 'Bevrijdingsdag',
|
232
|
+
Date.civil(2008,5,11) => 'Pinksteren', # Pentecost, Easter+49
|
233
|
+
Date.civil(2008,5,12) => 'Pinksteren', # Pentecost, Easter+50
|
234
|
+
Date.civil(2008,12,25) => 'Kerstmis',
|
235
|
+
Date.civil(2008,12,26) => 'Kerstmis'}.each do |date, name|
|
236
|
+
assert_equal name, (Holidays.on(date, :nl, :informal)[0] || {})[:name]
|
237
|
+
end
|
238
|
+
|
239
|
+
{Date.civil(2010,1,1) => 'Nyttårsdag',
|
240
|
+
Date.civil(2010,5,1) => '1. mai',
|
241
|
+
Date.civil(2010,5,17) => '17. mai',
|
242
|
+
Date.civil(2010,12,24) => 'Julaften',
|
243
|
+
Date.civil(2010,12,25) => '1. juledag',
|
244
|
+
Date.civil(2010,12,26) => '2. juledag',
|
245
|
+
Date.civil(2010,12,31) => 'Nyttårsaften',
|
246
|
+
Date.civil(2010,2,14) => 'Fastelavn',
|
247
|
+
Date.civil(2010,3,28) => 'Palmesøndag',
|
248
|
+
Date.civil(2010,4,1) => 'Skjærtorsdag',
|
249
|
+
Date.civil(2010,4,2) => 'Langfredag',
|
250
|
+
Date.civil(2010,4,4) => '1. påskedag',
|
251
|
+
Date.civil(2010,4,5) => '2. påskedag',
|
252
|
+
Date.civil(2010,5,13) => 'Kristi Himmelfartsdag',
|
253
|
+
Date.civil(2010,5,23) => '1. pinsedag',
|
254
|
+
Date.civil(2010,5,24) => '2. pinsedag'}.each do |date, name|
|
255
|
+
assert_equal name, (Holidays.on(date, :no, :informal)[0] || {})[:name]
|
256
|
+
end
|
257
|
+
|
258
|
+
{Date.civil(2008,1,1) => 'Ano Novo',
|
259
|
+
Date.civil(2005,2,8) => 'Carnaval',
|
260
|
+
Date.civil(2006,2,28) => 'Carnaval',
|
261
|
+
Date.civil(2007,2,20) => 'Carnaval',
|
262
|
+
Date.civil(2008,2,5) => 'Carnaval',
|
263
|
+
Date.civil(2008,3,21) => 'Sexta-feira Santa',
|
264
|
+
Date.civil(2008,3,23) => 'Páscoa',
|
265
|
+
Date.civil(2008,4,25) => 'Dia da Liberdade',
|
266
|
+
Date.civil(2008,5,1) => 'Dia do Trabalhador',
|
267
|
+
Date.civil(2005,5,26) => 'Corpo de Deus',
|
268
|
+
Date.civil(2007,6,7) => 'Corpo de Deus',
|
269
|
+
Date.civil(2008,5,22) => 'Corpo de Deus',
|
270
|
+
Date.civil(2008,6,10) => 'Dia de Portugal',
|
271
|
+
Date.civil(2008,8,15) => 'Assunção de Nossa Senhora',
|
272
|
+
Date.civil(2008,10,5) => 'Implantação da República',
|
273
|
+
Date.civil(2008,11,1) => 'Todos os Santos',
|
274
|
+
Date.civil(2008,12,1) => 'Restauração da Independência',
|
275
|
+
Date.civil(2008,12,8) => 'Imaculada Conceição',
|
276
|
+
Date.civil(2008,12,25) => 'Natal'}.each do |date, name|
|
277
|
+
assert_equal name, (Holidays.on(date, :pt, :informal)[0] || {})[:name]
|
278
|
+
end
|
279
|
+
end
|
280
|
+
end
|