holidays 0.9.3 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (86) hide show
  1. data/.gitignore +3 -0
  2. data/CHANGELOG +7 -0
  3. data/{README → README.rdoc} +36 -39
  4. data/data/SYNTAX +1 -1
  5. data/data/au.yaml +110 -105
  6. data/data/build_defs.rb +4 -3
  7. data/data/ca.yaml +140 -140
  8. data/data/cz.yaml +68 -0
  9. data/data/de.yaml +12 -14
  10. data/data/dk.yaml +1 -1
  11. data/data/es.yaml +1 -1
  12. data/data/fr.yaml +1 -1
  13. data/data/gb.yaml +1 -1
  14. data/data/ie.yaml +1 -1
  15. data/data/index.yaml +7 -2
  16. data/data/is.yaml +1 -1
  17. data/data/it.yaml +1 -1
  18. data/data/mx.yaml +1 -1
  19. data/data/nl.yaml +1 -1
  20. data/data/no.yaml +82 -0
  21. data/data/nyse.yaml +1 -1
  22. data/data/nz.yaml +141 -0
  23. data/data/pt.yaml +1 -1
  24. data/data/se.yaml +1 -1
  25. data/data/united_nations.yaml +188 -188
  26. data/data/ups.yaml +55 -55
  27. data/data/us.yaml +80 -80
  28. data/data/za.yaml +1 -1
  29. data/holidays.gemspec +155 -0
  30. data/lib/holidays.rb +424 -403
  31. data/lib/holidays/MANIFEST +28 -25
  32. data/lib/holidays/au.rb +43 -41
  33. data/lib/holidays/ca.rb +69 -68
  34. data/lib/holidays/cz.rb +36 -0
  35. data/lib/holidays/de.rb +51 -52
  36. data/lib/holidays/dk.rb +48 -47
  37. data/lib/holidays/es.rb +53 -52
  38. data/lib/holidays/europe.rb +236 -215
  39. data/lib/holidays/fr.rb +37 -36
  40. data/lib/holidays/gb.rb +41 -40
  41. data/lib/holidays/ie.rb +33 -32
  42. data/lib/holidays/is.rb +62 -61
  43. data/lib/holidays/it.rb +36 -35
  44. data/lib/holidays/mx.rb +52 -51
  45. data/lib/holidays/nl.rb +37 -36
  46. data/lib/holidays/no.rb +40 -0
  47. data/lib/holidays/north_america.rb +108 -107
  48. data/lib/holidays/nyse.rb +33 -32
  49. data/lib/holidays/nz.rb +69 -0
  50. data/lib/holidays/pt.rb +38 -52
  51. data/lib/holidays/scandinavia.rb +124 -114
  52. data/lib/holidays/se.rb +53 -52
  53. data/lib/holidays/united_nations.rb +25 -24
  54. data/lib/holidays/ups.rb +32 -31
  55. data/lib/holidays/us.rb +49 -48
  56. data/lib/holidays/za.rb +36 -35
  57. data/rakefile.rb +105 -113
  58. data/test/defs/test_defs_au.rb +36 -36
  59. data/test/defs/test_defs_ca.rb +29 -29
  60. data/test/defs/test_defs_cz.rb +26 -0
  61. data/test/defs/test_defs_de.rb +51 -46
  62. data/test/defs/test_defs_dk.rb +30 -30
  63. data/test/defs/test_defs_es.rb +57 -57
  64. data/test/defs/test_defs_europe.rb +280 -240
  65. data/test/defs/test_defs_fr.rb +26 -26
  66. data/test/defs/test_defs_gb.rb +36 -36
  67. data/test/defs/test_defs_ie.rb +21 -21
  68. data/test/defs/test_defs_is.rb +33 -33
  69. data/test/defs/test_defs_it.rb +25 -25
  70. data/test/defs/test_defs_mx.rb +22 -22
  71. data/test/defs/test_defs_nl.rb +24 -24
  72. data/test/defs/test_defs_no.rb +29 -0
  73. data/test/defs/test_defs_north_america.rb +54 -54
  74. data/test/defs/test_defs_nyse.rb +22 -22
  75. data/test/defs/test_defs_nz.rb +22 -0
  76. data/test/defs/test_defs_pt.rb +32 -32
  77. data/test/defs/test_defs_scandinavia.rb +94 -75
  78. data/test/defs/test_defs_se.rb +32 -32
  79. data/test/defs/test_defs_ups.rb +21 -21
  80. data/test/defs/test_defs_us.rb +23 -23
  81. data/test/defs/test_defs_za.rb +25 -25
  82. data/test/test_date.rb +123 -0
  83. data/test/test_helper.rb +22 -0
  84. data/test/test_holidays.rb +128 -0
  85. data/test/test_multiple_regions.rb +24 -0
  86. metadata +126 -73
@@ -1,36 +1,36 @@
1
- require File.dirname(__FILE__) + '/../test_helper'
2
- require 'holidays/au'
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
@@ -1,29 +1,29 @@
1
- require File.dirname(__FILE__) + '/../test_helper'
2
- require 'holidays/ca'
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
@@ -1,46 +1,51 @@
1
- require File.dirname(__FILE__) + '/../test_helper'
2
- require 'holidays/de'
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,12) => 'Ostern',
13
- Date.civil(2009,4,13) => 'Ostermontag',
14
- Date.civil(2009,5,1) => 'Tag der Arbeit',
15
- Date.civil(2009,5,21) => 'Christi Himmelfahrt',
16
- Date.civil(2009,6,1) => 'Pfingstmontag',
17
- Date.civil(2009,10,3) => 'Tag der Deutschen Einheit',
18
- Date.civil(2009,12,25) => '1. Weihnachtstag',
19
- Date.civil(2009,12,26) => '2. Weihnachtstag'}.each do |date, name|
20
- assert_equal name, Holidays.on(date, :de, :informal)[0][:name]
21
- end
22
-
23
- [:de_bw, :de_by, :de_he, :de_nw, :de_rp, :de_sl, :de_sn, :de_th, :de_].each do |r|
24
- assert_equal 'Fronleichnam', Date.civil(2009,6,11).holidays(r)[0][:name]
25
- end
26
-
27
- [:de_by, :de_sl, :de_].each do |r|
28
- assert_equal 'Mariä Himmelfahrt', Date.civil(2009,8,15).holidays(r)[0][:name]
29
- end
30
-
31
- [:de_bb, :de_mv, :de_sn, :de_st, :de_th, :de_].each do |r|
32
- assert_equal 'Reformationstag', Date.civil(2009,10,31).holidays(r)[0][:name]
33
- end
34
-
35
- [:de_bw, :de_by, :de_nw, :de_rp, :de_sl, :de_].each do |r|
36
- assert_equal 'Allerheiligen', Date.civil(2009,11,1).holidays(r)[0][:name]
37
- end
38
-
39
- # Repentance Day
40
- assert_equal 'Buß- und Bettag', Date.civil(2004,11,17).holidays(:de_sn)[0][:name]
41
- assert_equal 'Buß- und Bettag', Date.civil(2005,11,16).holidays(:de_sn)[0][:name]
42
- assert_equal 'Buß- und Bettag', Date.civil(2006,11,22).holidays(:de_sn)[0][:name]
43
- assert_equal 'Buß- und Bettag', Date.civil(2009,11,18).holidays(:de_sn)[0][:name]
44
-
45
- end
46
- 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/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
@@ -1,30 +1,30 @@
1
- require File.dirname(__FILE__) + '/../test_helper'
2
- require 'holidays/dk'
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
@@ -1,57 +1,57 @@
1
- require File.dirname(__FILE__) + '/../test_helper'
2
- require 'holidays/es'
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
- require File.dirname(__FILE__) + '/../test_helper'
2
- require 'holidays/europe'
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(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
-
30
- {Date.civil(2009,1,1) => 'Neujahrstag',
31
- Date.civil(2009,4,10) => 'Karfreitag',
32
- Date.civil(2009,4,12) => 'Ostern',
33
- Date.civil(2009,4,13) => 'Ostermontag',
34
- Date.civil(2009,5,1) => 'Tag der Arbeit',
35
- Date.civil(2009,5,21) => 'Christi Himmelfahrt',
36
- Date.civil(2009,6,1) => 'Pfingstmontag',
37
- Date.civil(2009,10,3) => 'Tag der Deutschen Einheit',
38
- Date.civil(2009,12,25) => '1. Weihnachtstag',
39
- Date.civil(2009,12,26) => '2. Weihnachtstag'}.each do |date, name|
40
- assert_equal name, Holidays.on(date, :de, :informal)[0][:name]
41
- end
42
-
43
- [:de_bw, :de_by, :de_he, :de_nw, :de_rp, :de_sl, :de_sn, :de_th, :de_].each do |r|
44
- assert_equal 'Fronleichnam', Date.civil(2009,6,11).holidays(r)[0][:name]
45
- end
46
-
47
- [:de_by, :de_sl, :de_].each do |r|
48
- assert_equal 'Mariä Himmelfahrt', Date.civil(2009,8,15).holidays(r)[0][:name]
49
- end
50
-
51
- [:de_bb, :de_mv, :de_sn, :de_st, :de_th, :de_].each do |r|
52
- assert_equal 'Reformationstag', Date.civil(2009,10,31).holidays(r)[0][:name]
53
- end
54
-
55
- [:de_bw, :de_by, :de_nw, :de_rp, :de_sl, :de_].each do |r|
56
- assert_equal 'Allerheiligen', Date.civil(2009,11,1).holidays(r)[0][:name]
57
- end
58
-
59
- # Repentance Day
60
- assert_equal 'Buß- und Bettag', Date.civil(2004,11,17).holidays(:de_sn)[0][:name]
61
- assert_equal 'Buß- und Bettag', Date.civil(2005,11,16).holidays(:de_sn)[0][:name]
62
- assert_equal 'Buß- und Bettag', Date.civil(2006,11,22).holidays(:de_sn)[0][:name]
63
- assert_equal 'Buß- und Bettag', Date.civil(2009,11,18).holidays(:de_sn)[0][:name]
64
-
65
-
66
- {Date.civil(2009,1,1) => 'Año Nuevo',
67
- Date.civil(2009,1,6) => 'Día de Reyes',
68
- Date.civil(2009,4,10) => 'Viernes Santo',
69
- Date.civil(2009,5,1) => 'Día del Trabajador',
70
- Date.civil(2009,8,15) => 'Asunción',
71
- Date.civil(2009,10,12) => 'Día de la Hispanidad',
72
- Date.civil(2009,11,1) => 'Todos los Santos',
73
- Date.civil(2009,12,6) => 'Día de la Constitución',
74
- Date.civil(2009,12,8) => 'Inmaculada Concepción',
75
- Date.civil(2009,12,25) => 'Navidad del Señor'}.each do |date, name|
76
- assert_equal name, Holidays.on(date, :es, :informal)[0][:name]
77
- end
78
-
79
- [:es_pv, :es_ct, :es_na, :es_v, :es_vc, :es_].each do |r|
80
- assert_equal 'Jueves Santo', Date.civil(2009,4,9).holidays(r)[0][:name]
81
- assert_equal 'Lunes de Pascua', Date.civil(2009,4,13).holidays(r)[0][:name]
82
- end
83
-
84
- [:es_v, :es_vc, :es_cm, :es_mu, :es_m, :es_].each do |r|
85
- assert_equal 'San José', Date.civil(2009,3,19).holidays(r)[0][:name]
86
- end
87
-
88
- [:es_ar, :es_cl, :es_].each do |r|
89
- assert_equal 'San Jorge', Date.civil(2009,4,23).holidays(r)[0][:name]
90
- end
91
-
92
- [:es_vc, :es_v, :es_].each do |r|
93
- assert_equal 'Día de Valencia', Date.civil(2009,10,9).holidays(r)[0][:name]
94
- end
95
-
96
- [:es_ib, :es_ct, :es_].each do |r|
97
- assert_equal 'San Esteban', Date.civil(2009,12,26).holidays(r)[0][:name]
98
- end
99
-
100
- assert_equal 'Día de Andalucía', Date.civil(2009,2,28).holidays(:es_an)[0][:name]
101
- assert_equal 'Día de las Islas Baleares', Date.civil(2009,3,1).holidays(:es_ib)[0][:name]
102
- assert_equal 'Fiesta de la Comunidad', Date.civil(2006,5,2).holidays(:es_m)[0][:name]
103
- assert_equal 'Día de las Canarias', Date.civil(2006,5,30).holidays(:es_cn)[0][:name]
104
- assert_equal 'Día de la Región Castilla-La Mancha', Date.civil(2009,5,31).holidays(:es_cm)[0][:name]
105
- assert_equal 'Día de la Región de Murcia', Date.civil(2009,6,9).holidays(:es_mu)[0][:name]
106
- assert_equal 'Día de La Rioja', Date.civil(2009,6,9).holidays(:es_lo)[0][:name]
107
- assert_equal 'Santiago Apostol', Date.civil(2009,7,23).holidays(:es_ga)[0][:name]
108
- assert_equal 'Día de Ceuta', Date.civil(2009,9,2).holidays(:es_ce)[0][:name]
109
- assert_equal 'Día de Asturias', Date.civil(2009,9,8).holidays(:es_o)[0][:name]
110
- assert_equal 'Día de Extremadura', Date.civil(2009,9,8).holidays(:es_ex)[0][:name]
111
- assert_equal 'Fiesta Nacional de Cataluña', Date.civil(2009,9,11).holidays(:es_ct)[0][:name]
112
-
113
- {Date.civil(2007,1,1) => 'Jour de l\'an',
114
- Date.civil(2007,4,8) => 'Pâques',
115
- Date.civil(2007,4,9) => 'Lundi de Pâques',
116
- Date.civil(2007,5,1) => 'Fête du travail',
117
- Date.civil(2007,5,8) => 'Victoire 1945',
118
- Date.civil(2007,5,17) => 'Ascension',
119
- Date.civil(2007,5,27) => 'Pentecôte',
120
- Date.civil(2007,5,28) => 'Lundi de Pentecôte',
121
- Date.civil(2007,7,14) => 'Fête nationale',
122
- Date.civil(2007,8,15) => 'Assomption',
123
- Date.civil(2007,11,1) => 'Toussaint',
124
- Date.civil(2007,11,11) => 'Armistice 1918',
125
- Date.civil(2007,12,25) => 'Nöel'}.each do |date, name|
126
- assert_equal name, Holidays.on(date, :fr, :informal)[0][:name]
127
- end
128
-
129
- {Date.civil(2008,1,1) => 'New Year\'s Day',
130
- Date.civil(2008,3,21) => 'Good Friday',
131
- Date.civil(2008,3,23) => 'Easter Sunday',
132
- Date.civil(2008,5,5) => 'May Day',
133
- Date.civil(2008,5,26) => 'Bank Holiday',
134
- Date.civil(2008,11,5) => 'Guy Fawkes Day',
135
- Date.civil(2008,12,25) => 'Christmas Day',
136
- Date.civil(2008,12,26) => 'Boxing Day'}.each do |date, name|
137
- assert_equal name, Holidays.on(date, :gb, :informal)[0][:name]
138
- end
139
-
140
- assert_equal 'St. Patrick\'s Day', Date.civil(2008,3,17).holidays(:gb_nir, :informal)[0][:name]
141
-
142
- assert_equal 'Christmas Day', Date.civil(2008,12,25).holidays(:gb_, :observed)[0][:name]
143
- assert_equal 'Christmas Day', Date.civil(2009,12,25).holidays(:gb_, :observed)[0][:name]
144
- assert_equal 'Christmas Day', Date.civil(2010,12,27).holidays(:gb_, :observed)[0][:name]
145
-
146
- assert_equal 'Boxing Day', Date.civil(2008,12,26).holidays(:gb_, :observed)[0][:name]
147
- assert_equal 'Boxing Day', Date.civil(2009,12,28).holidays(:gb_, :observed)[0][:name]
148
- assert_equal 'Boxing Day', Date.civil(2010,12,28).holidays(:gb_, :observed)[0][:name]
149
-
150
- [:gb_wls, :gb_eng, :gb_nir, :gb_eaw, :gb_].each do |r|
151
- assert_equal 'Easter Monday', Date.civil(2008,3,24).holidays(r)[0][:name]
152
- assert_equal 'Bank Holiday', Date.civil(2008,8,25).holidays(r)[0][:name]
153
- end
154
-
155
- {Date.civil(2008,1,1) => 'New Year\'s Day',
156
- Date.civil(2008,3,17) => 'St. Patrick\'s Day',
157
- Date.civil(2008,3,24) => 'Easter Monday',
158
- Date.civil(2008,5,5) => 'May Day',
159
- Date.civil(2008,6,2) => 'Bank Holiday',
160
- Date.civil(2008,8,4) => 'Bank Holiday',
161
- Date.civil(2008,12,25) => 'Christmas Day',
162
- Date.civil(2008,12,26) => 'St. Stephen\'s Day'}.each do |date, name|
163
- assert_equal name, Holidays.on(date, :ie, :informal)[0][:name]
164
- end
165
-
166
- {Date.civil(2007,1,1) => 'Nýársdagur',
167
- Date.civil(2007,1,6) => 'Þrettándinn',
168
- Date.civil(2007,1,19) => 'Bóndadagur',
169
- Date.civil(2007,2,18) => 'Konudagur',
170
- Date.civil(2007,4,5) => 'Skírdagur',
171
- Date.civil(2007,4,6) => 'Föstudaginn langi',
172
- Date.civil(2007,4,8) => 'Páskadagur',
173
- Date.civil(2007,4,9) => 'Annar í páskum',
174
- Date.civil(2007,4,19) => 'Sumardagurinn fyrsti',
175
- Date.civil(2007,5,1) => 'Verkalýðsdagurinn',
176
- Date.civil(2007,5,17) => 'Uppstigningardagur',
177
- Date.civil(2007,5,27) => 'Hvítasunnudagur',
178
- Date.civil(2007,5,28) => 'Annar í hvítasunnu',
179
- Date.civil(2007,6,3) => 'Sjómannadagurinn',
180
- Date.civil(2007,6,17) => 'Lýðveldisdagurinn',
181
- Date.civil(2007,8,6) => 'Frídagur verslunarmanna',
182
- Date.civil(2007,12,24) => 'Jól',
183
- Date.civil(2007,12,25) => 'Jól',
184
- Date.civil(2007,12,26) => 'Jól',
185
- Date.civil(2007,12,31) => 'Gamlárskvöld'}.each do |date, name|
186
- assert_equal name, Holidays.on(date, :is, :informal)[0][:name]
187
- end
188
-
189
- {Date.civil(2007,1,1) => 'Capodanno',
190
- Date.civil(2007,1,6) => 'Epifania',
191
- Date.civil(2007,4,8) => 'Pasqua',
192
- Date.civil(2007,4,9) => 'Lunedì dell\'Angelo',
193
- Date.civil(2007,4,25) => 'Festa della Liberazione',
194
- Date.civil(2007,5,1) => 'Festa dei Lavoratori',
195
- Date.civil(2007,6,2) => 'Festa della Repubblica',
196
- Date.civil(2007,8,15) => 'Assunzione',
197
- Date.civil(2007,11,1) => 'Ognissanti',
198
- Date.civil(2007,12,8) => 'Immacolata Concezione',
199
- Date.civil(2007,12,25) => 'Natale',
200
- Date.civil(2007,12,26) => 'Santo Stefano'}.each do |date, name|
201
- assert_equal name, Holidays.on(date, :it, :informal)[0][:name]
202
- end
203
-
204
- {Date.civil(2008,1,1) => 'Nieuwjaar',
205
- Date.civil(2008,3,21) => 'Goede Vrijdag',
206
- Date.civil(2008,3,23) => 'Pasen',
207
- Date.civil(2008,3,24) => 'Pasen',
208
- Date.civil(2008,4,30) => 'Koninginnedag',
209
- Date.civil(2008,5,1) => 'Hemelvaartsdag', # Ascension, Easter+39
210
- Date.civil(2008,5,5) => 'Bevrijdingsdag',
211
- Date.civil(2008,5,11) => 'Pinksteren', # Pentecost, Easter+49
212
- Date.civil(2008,5,12) => 'Pinksteren', # Pentecost, Easter+50
213
- Date.civil(2008,12,25) => 'Kerstmis',
214
- Date.civil(2008,12,26) => 'Kerstmis'}.each do |date, name|
215
- assert_equal name, Holidays.on(date, :nl, :informal)[0][:name]
216
- end
217
-
218
- {Date.civil(2008,1,1) => 'Ano Novo',
219
- Date.civil(2005,2,8) => 'Carnaval',
220
- Date.civil(2006,2,28) => 'Carnaval',
221
- Date.civil(2007,2,20) => 'Carnaval',
222
- Date.civil(2008,2,5) => 'Carnaval',
223
- Date.civil(2008,3,21) => 'Sexta-feira Santa',
224
- Date.civil(2008,3,23) => 'Páscoa',
225
- Date.civil(2008,4,25) => 'Dia da Liberdade',
226
- Date.civil(2008,5,1) => 'Dia do Trabalhador',
227
- Date.civil(2005,5,26) => 'Corpo de Deus',
228
- Date.civil(2007,6,7) => 'Corpo de Deus',
229
- Date.civil(2008,5,22) => 'Corpo de Deus',
230
- Date.civil(2008,6,10) => 'Dia de Portugal',
231
- Date.civil(2008,8,15) => 'Assunção de Nossa Senhora',
232
- Date.civil(2008,10,5) => 'Implantação da República',
233
- Date.civil(2008,11,1) => 'Todos os Santos',
234
- Date.civil(2008,12,1) => 'Restauração da Independência',
235
- Date.civil(2008,12,8) => 'Imaculada Conceição',
236
- Date.civil(2008,12,25) => 'Natal'}.each do |date, name|
237
- assert_equal name, Holidays.on(date, :pt, :informal)[0][:name]
238
- end
239
- end
240
- 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/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