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,26 +1,26 @@
1
- require File.dirname(__FILE__) + '/../test_helper'
2
- require 'holidays/fr'
3
-
4
- # This file is generated by the Ruby Holiday gem.
5
- #
6
- # Definitions loaded: data/fr.yaml
7
- class FrDefinitionTests < Test::Unit::TestCase # :nodoc:
8
-
9
- def test_fr
10
- {Date.civil(2007,1,1) => 'Jour de l\'an',
11
- Date.civil(2007,4,8) => 'Pâques',
12
- Date.civil(2007,4,9) => 'Lundi de Pâques',
13
- Date.civil(2007,5,1) => 'Fête du travail',
14
- Date.civil(2007,5,8) => 'Victoire 1945',
15
- Date.civil(2007,5,17) => 'Ascension',
16
- Date.civil(2007,5,27) => 'Pentecôte',
17
- Date.civil(2007,5,28) => 'Lundi de Pentecôte',
18
- Date.civil(2007,7,14) => 'Fête nationale',
19
- Date.civil(2007,8,15) => 'Assomption',
20
- Date.civil(2007,11,1) => 'Toussaint',
21
- Date.civil(2007,11,11) => 'Armistice 1918',
22
- Date.civil(2007,12,25) => 'Nöel'}.each do |date, name|
23
- assert_equal name, Holidays.on(date, :fr, :informal)[0][:name]
24
- end
25
- end
26
- 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/fr.yaml
7
+ class FrDefinitionTests < Test::Unit::TestCase # :nodoc:
8
+
9
+ def test_fr
10
+ {Date.civil(2007,1,1) => 'Jour de l\'an',
11
+ Date.civil(2007,4,8) => 'Pâques',
12
+ Date.civil(2007,4,9) => 'Lundi de Pâques',
13
+ Date.civil(2007,5,1) => 'Fête du travail',
14
+ Date.civil(2007,5,8) => 'Victoire 1945',
15
+ Date.civil(2007,5,17) => 'Ascension',
16
+ Date.civil(2007,5,27) => 'Pentecôte',
17
+ Date.civil(2007,5,28) => 'Lundi de Pentecôte',
18
+ Date.civil(2007,7,14) => 'Fête nationale',
19
+ Date.civil(2007,8,15) => 'Assomption',
20
+ Date.civil(2007,11,1) => 'Toussaint',
21
+ Date.civil(2007,11,11) => 'Armistice 1918',
22
+ Date.civil(2007,12,25) => 'Nöel'}.each do |date, name|
23
+ assert_equal name, (Holidays.on(date, :fr, :informal)[0] || {})[:name]
24
+ end
25
+ end
26
+ end
@@ -1,36 +1,36 @@
1
- require File.dirname(__FILE__) + '/../test_helper'
2
- require 'holidays/gb'
3
-
4
- # This file is generated by the Ruby Holiday gem.
5
- #
6
- # Definitions loaded: data/gb.yaml
7
- class GbDefinitionTests < Test::Unit::TestCase # :nodoc:
8
-
9
- def test_gb
10
- {Date.civil(2008,1,1) => 'New Year\'s Day',
11
- Date.civil(2008,3,21) => 'Good Friday',
12
- Date.civil(2008,3,23) => 'Easter Sunday',
13
- Date.civil(2008,5,5) => 'May Day',
14
- Date.civil(2008,5,26) => 'Bank Holiday',
15
- Date.civil(2008,11,5) => 'Guy Fawkes Day',
16
- Date.civil(2008,12,25) => 'Christmas Day',
17
- Date.civil(2008,12,26) => 'Boxing Day'}.each do |date, name|
18
- assert_equal name, Holidays.on(date, :gb, :informal)[0][:name]
19
- end
20
-
21
- assert_equal 'St. Patrick\'s Day', Date.civil(2008,3,17).holidays(:gb_nir, :informal)[0][:name]
22
-
23
- assert_equal 'Christmas Day', Date.civil(2008,12,25).holidays(:gb_, :observed)[0][:name]
24
- assert_equal 'Christmas Day', Date.civil(2009,12,25).holidays(:gb_, :observed)[0][:name]
25
- assert_equal 'Christmas Day', Date.civil(2010,12,27).holidays(:gb_, :observed)[0][:name]
26
-
27
- assert_equal 'Boxing Day', Date.civil(2008,12,26).holidays(:gb_, :observed)[0][:name]
28
- assert_equal 'Boxing Day', Date.civil(2009,12,28).holidays(:gb_, :observed)[0][:name]
29
- assert_equal 'Boxing Day', Date.civil(2010,12,28).holidays(:gb_, :observed)[0][:name]
30
-
31
- [:gb_wls, :gb_eng, :gb_nir, :gb_eaw, :gb_].each do |r|
32
- assert_equal 'Easter Monday', Date.civil(2008,3,24).holidays(r)[0][:name]
33
- assert_equal 'Bank Holiday', Date.civil(2008,8,25).holidays(r)[0][:name]
34
- end
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/gb.yaml
7
+ class GbDefinitionTests < Test::Unit::TestCase # :nodoc:
8
+
9
+ def test_gb
10
+ {Date.civil(2008,1,1) => 'New Year\'s Day',
11
+ Date.civil(2008,3,21) => 'Good Friday',
12
+ Date.civil(2008,3,23) => 'Easter Sunday',
13
+ Date.civil(2008,5,5) => 'May Day',
14
+ Date.civil(2008,5,26) => 'Bank Holiday',
15
+ Date.civil(2008,11,5) => 'Guy Fawkes Day',
16
+ Date.civil(2008,12,25) => 'Christmas Day',
17
+ Date.civil(2008,12,26) => 'Boxing Day'}.each do |date, name|
18
+ assert_equal name, (Holidays.on(date, :gb, :informal)[0] || {})[:name]
19
+ end
20
+
21
+ assert_equal 'St. Patrick\'s Day', Date.civil(2008,3,17).holidays(:gb_nir, :informal)[0][:name]
22
+
23
+ assert_equal 'Christmas Day', Date.civil(2008,12,25).holidays(:gb_, :observed)[0][:name]
24
+ assert_equal 'Christmas Day', Date.civil(2009,12,25).holidays(:gb_, :observed)[0][:name]
25
+ assert_equal 'Christmas Day', Date.civil(2010,12,27).holidays(:gb_, :observed)[0][:name]
26
+
27
+ assert_equal 'Boxing Day', Date.civil(2008,12,26).holidays(:gb_, :observed)[0][:name]
28
+ assert_equal 'Boxing Day', Date.civil(2009,12,28).holidays(:gb_, :observed)[0][:name]
29
+ assert_equal 'Boxing Day', Date.civil(2010,12,28).holidays(:gb_, :observed)[0][:name]
30
+
31
+ [:gb_wls, :gb_eng, :gb_nir, :gb_eaw, :gb_].each do |r|
32
+ assert_equal 'Easter Monday', Date.civil(2008,3,24).holidays(r)[0][:name]
33
+ assert_equal 'Bank Holiday', Date.civil(2008,8,25).holidays(r)[0][:name]
34
+ end
35
+ end
36
+ end
@@ -1,21 +1,21 @@
1
- require File.dirname(__FILE__) + '/../test_helper'
2
- require 'holidays/ie'
3
-
4
- # This file is generated by the Ruby Holiday gem.
5
- #
6
- # Definitions loaded: data/ie.yaml
7
- class IeDefinitionTests < Test::Unit::TestCase # :nodoc:
8
-
9
- def test_ie
10
- {Date.civil(2008,1,1) => 'New Year\'s Day',
11
- Date.civil(2008,3,17) => 'St. Patrick\'s Day',
12
- Date.civil(2008,3,24) => 'Easter Monday',
13
- Date.civil(2008,5,5) => 'May Day',
14
- Date.civil(2008,6,2) => 'Bank Holiday',
15
- Date.civil(2008,8,4) => 'Bank Holiday',
16
- Date.civil(2008,12,25) => 'Christmas Day',
17
- Date.civil(2008,12,26) => 'St. Stephen\'s Day'}.each do |date, name|
18
- assert_equal name, Holidays.on(date, :ie, :informal)[0][:name]
19
- end
20
- end
21
- 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/ie.yaml
7
+ class IeDefinitionTests < Test::Unit::TestCase # :nodoc:
8
+
9
+ def test_ie
10
+ {Date.civil(2008,1,1) => 'New Year\'s Day',
11
+ Date.civil(2008,3,17) => 'St. Patrick\'s Day',
12
+ Date.civil(2008,3,24) => 'Easter Monday',
13
+ Date.civil(2008,5,5) => 'May Day',
14
+ Date.civil(2008,6,2) => 'Bank Holiday',
15
+ Date.civil(2008,8,4) => 'Bank Holiday',
16
+ Date.civil(2008,12,25) => 'Christmas Day',
17
+ Date.civil(2008,12,26) => 'St. Stephen\'s Day'}.each do |date, name|
18
+ assert_equal name, (Holidays.on(date, :ie, :informal)[0] || {})[:name]
19
+ end
20
+ end
21
+ end
@@ -1,33 +1,33 @@
1
- require File.dirname(__FILE__) + '/../test_helper'
2
- require 'holidays/is'
3
-
4
- # This file is generated by the Ruby Holiday gem.
5
- #
6
- # Definitions loaded: data/is.yaml
7
- class IsDefinitionTests < Test::Unit::TestCase # :nodoc:
8
-
9
- def test_is
10
- {Date.civil(2007,1,1) => 'Nýársdagur',
11
- Date.civil(2007,1,6) => 'Þrettándinn',
12
- Date.civil(2007,1,19) => 'Bóndadagur',
13
- Date.civil(2007,2,18) => 'Konudagur',
14
- Date.civil(2007,4,5) => 'Skírdagur',
15
- Date.civil(2007,4,6) => 'Föstudaginn langi',
16
- Date.civil(2007,4,8) => 'Páskadagur',
17
- Date.civil(2007,4,9) => 'Annar í páskum',
18
- Date.civil(2007,4,19) => 'Sumardagurinn fyrsti',
19
- Date.civil(2007,5,1) => 'Verkalýðsdagurinn',
20
- Date.civil(2007,5,17) => 'Uppstigningardagur',
21
- Date.civil(2007,5,27) => 'Hvítasunnudagur',
22
- Date.civil(2007,5,28) => 'Annar í hvítasunnu',
23
- Date.civil(2007,6,3) => 'Sjómannadagurinn',
24
- Date.civil(2007,6,17) => 'Lýðveldisdagurinn',
25
- Date.civil(2007,8,6) => 'Frídagur verslunarmanna',
26
- Date.civil(2007,12,24) => 'Jól',
27
- Date.civil(2007,12,25) => 'Jól',
28
- Date.civil(2007,12,26) => 'Jól',
29
- Date.civil(2007,12,31) => 'Gamlárskvöld'}.each do |date, name|
30
- assert_equal name, Holidays.on(date, :is, :informal)[0][:name]
31
- end
32
- end
33
- 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/is.yaml
7
+ class IsDefinitionTests < Test::Unit::TestCase # :nodoc:
8
+
9
+ def test_is
10
+ {Date.civil(2007,1,1) => 'Nýársdagur',
11
+ Date.civil(2007,1,6) => 'Þrettándinn',
12
+ Date.civil(2007,1,19) => 'Bóndadagur',
13
+ Date.civil(2007,2,18) => 'Konudagur',
14
+ Date.civil(2007,4,5) => 'Skírdagur',
15
+ Date.civil(2007,4,6) => 'Föstudaginn langi',
16
+ Date.civil(2007,4,8) => 'Páskadagur',
17
+ Date.civil(2007,4,9) => 'Annar í páskum',
18
+ Date.civil(2007,4,19) => 'Sumardagurinn fyrsti',
19
+ Date.civil(2007,5,1) => 'Verkalýðsdagurinn',
20
+ Date.civil(2007,5,17) => 'Uppstigningardagur',
21
+ Date.civil(2007,5,27) => 'Hvítasunnudagur',
22
+ Date.civil(2007,5,28) => 'Annar í hvítasunnu',
23
+ Date.civil(2007,6,3) => 'Sjómannadagurinn',
24
+ Date.civil(2007,6,17) => 'Lýðveldisdagurinn',
25
+ Date.civil(2007,8,6) => 'Frídagur verslunarmanna',
26
+ Date.civil(2007,12,24) => 'Jól',
27
+ Date.civil(2007,12,25) => 'Jól',
28
+ Date.civil(2007,12,26) => 'Jól',
29
+ Date.civil(2007,12,31) => 'Gamlárskvöld'}.each do |date, name|
30
+ assert_equal name, (Holidays.on(date, :is, :informal)[0] || {})[:name]
31
+ end
32
+ end
33
+ end
@@ -1,25 +1,25 @@
1
- require File.dirname(__FILE__) + '/../test_helper'
2
- require 'holidays/it'
3
-
4
- # This file is generated by the Ruby Holiday gem.
5
- #
6
- # Definitions loaded: data/it.yaml
7
- class ItDefinitionTests < Test::Unit::TestCase # :nodoc:
8
-
9
- def test_it
10
- {Date.civil(2007,1,1) => 'Capodanno',
11
- Date.civil(2007,1,6) => 'Epifania',
12
- Date.civil(2007,4,8) => 'Pasqua',
13
- Date.civil(2007,4,9) => 'Lunedì dell\'Angelo',
14
- Date.civil(2007,4,25) => 'Festa della Liberazione',
15
- Date.civil(2007,5,1) => 'Festa dei Lavoratori',
16
- Date.civil(2007,6,2) => 'Festa della Repubblica',
17
- Date.civil(2007,8,15) => 'Assunzione',
18
- Date.civil(2007,11,1) => 'Ognissanti',
19
- Date.civil(2007,12,8) => 'Immacolata Concezione',
20
- Date.civil(2007,12,25) => 'Natale',
21
- Date.civil(2007,12,26) => 'Santo Stefano'}.each do |date, name|
22
- assert_equal name, Holidays.on(date, :it, :informal)[0][:name]
23
- end
24
- end
25
- 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/it.yaml
7
+ class ItDefinitionTests < Test::Unit::TestCase # :nodoc:
8
+
9
+ def test_it
10
+ {Date.civil(2007,1,1) => 'Capodanno',
11
+ Date.civil(2007,1,6) => 'Epifania',
12
+ Date.civil(2007,4,8) => 'Pasqua',
13
+ Date.civil(2007,4,9) => 'Lunedì dell\'Angelo',
14
+ Date.civil(2007,4,25) => 'Festa della Liberazione',
15
+ Date.civil(2007,5,1) => 'Festa dei Lavoratori',
16
+ Date.civil(2007,6,2) => 'Festa della Repubblica',
17
+ Date.civil(2007,8,15) => 'Assunzione',
18
+ Date.civil(2007,11,1) => 'Ognissanti',
19
+ Date.civil(2007,12,8) => 'Immacolata Concezione',
20
+ Date.civil(2007,12,25) => 'Natale',
21
+ Date.civil(2007,12,26) => 'Santo Stefano'}.each do |date, name|
22
+ assert_equal name, (Holidays.on(date, :it, :informal)[0] || {})[:name]
23
+ end
24
+ end
25
+ end
@@ -1,22 +1,22 @@
1
- require File.dirname(__FILE__) + '/../test_helper'
2
- require 'holidays/mx'
3
-
4
- # This file is generated by the Ruby Holiday gem.
5
- #
6
- # Definitions loaded: data/mx.yaml, data/north_america_informal.yaml
7
- class MxDefinitionTests < Test::Unit::TestCase # :nodoc:
8
-
9
- def test_mx
10
- {Date.civil(2007,1,1) => 'Año nuevo',
11
- Date.civil(2007,2,5) => 'Día de la Constitución',
12
- Date.civil(2007,5,1) => 'Día del Trabajo',
13
- Date.civil(2007,5,5) => 'Cinco de Mayo',
14
- Date.civil(2007,9,16) => 'Día de la Independencia',
15
- Date.civil(2007,11,1) => 'Todos los Santos',
16
- Date.civil(2007,11,2) => 'Los Fieles Difuntos',
17
- Date.civil(2007,11,19) => 'Día de la Revolución',
18
- Date.civil(2007,12,25) => 'Navidad'}.each do |date, name|
19
- assert_equal name, Holidays.on(date, :mx, :informal)[0][:name]
20
- end
21
- end
22
- 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/mx.yaml, data/north_america_informal.yaml
7
+ class MxDefinitionTests < Test::Unit::TestCase # :nodoc:
8
+
9
+ def test_mx
10
+ {Date.civil(2007,1,1) => 'Año nuevo',
11
+ Date.civil(2007,2,5) => 'Día de la Constitución',
12
+ Date.civil(2007,5,1) => 'Día del Trabajo',
13
+ Date.civil(2007,5,5) => 'Cinco de Mayo',
14
+ Date.civil(2007,9,16) => 'Día de la Independencia',
15
+ Date.civil(2007,11,1) => 'Todos los Santos',
16
+ Date.civil(2007,11,2) => 'Los Fieles Difuntos',
17
+ Date.civil(2007,11,19) => 'Día de la Revolución',
18
+ Date.civil(2007,12,25) => 'Navidad'}.each do |date, name|
19
+ assert_equal name, (Holidays.on(date, :mx, :informal)[0] || {})[:name]
20
+ end
21
+ end
22
+ end
@@ -1,24 +1,24 @@
1
- require File.dirname(__FILE__) + '/../test_helper'
2
- require 'holidays/nl'
3
-
4
- # This file is generated by the Ruby Holiday gem.
5
- #
6
- # Definitions loaded: data/nl.yaml
7
- class NlDefinitionTests < Test::Unit::TestCase # :nodoc:
8
-
9
- def test_nl
10
- {Date.civil(2008,1,1) => 'Nieuwjaar',
11
- Date.civil(2008,3,21) => 'Goede Vrijdag',
12
- Date.civil(2008,3,23) => 'Pasen',
13
- Date.civil(2008,3,24) => 'Pasen',
14
- Date.civil(2008,4,30) => 'Koninginnedag',
15
- Date.civil(2008,5,1) => 'Hemelvaartsdag', # Ascension, Easter+39
16
- Date.civil(2008,5,5) => 'Bevrijdingsdag',
17
- Date.civil(2008,5,11) => 'Pinksteren', # Pentecost, Easter+49
18
- Date.civil(2008,5,12) => 'Pinksteren', # Pentecost, Easter+50
19
- Date.civil(2008,12,25) => 'Kerstmis',
20
- Date.civil(2008,12,26) => 'Kerstmis'}.each do |date, name|
21
- assert_equal name, Holidays.on(date, :nl, :informal)[0][:name]
22
- end
23
- end
24
- 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/nl.yaml
7
+ class NlDefinitionTests < Test::Unit::TestCase # :nodoc:
8
+
9
+ def test_nl
10
+ {Date.civil(2008,1,1) => 'Nieuwjaar',
11
+ Date.civil(2008,3,21) => 'Goede Vrijdag',
12
+ Date.civil(2008,3,23) => 'Pasen',
13
+ Date.civil(2008,3,24) => 'Pasen',
14
+ Date.civil(2008,4,30) => 'Koninginnedag',
15
+ Date.civil(2008,5,1) => 'Hemelvaartsdag', # Ascension, Easter+39
16
+ Date.civil(2008,5,5) => 'Bevrijdingsdag',
17
+ Date.civil(2008,5,11) => 'Pinksteren', # Pentecost, Easter+49
18
+ Date.civil(2008,5,12) => 'Pinksteren', # Pentecost, Easter+50
19
+ Date.civil(2008,12,25) => 'Kerstmis',
20
+ Date.civil(2008,12,26) => 'Kerstmis'}.each do |date, name|
21
+ assert_equal name, (Holidays.on(date, :nl, :informal)[0] || {})[:name]
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,29 @@
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/no.yaml
7
+ class NoDefinitionTests < Test::Unit::TestCase # :nodoc:
8
+
9
+ def test_no
10
+ {Date.civil(2010,1,1) => 'Nyttårsdag',
11
+ Date.civil(2010,5,1) => '1. mai',
12
+ Date.civil(2010,5,17) => '17. mai',
13
+ Date.civil(2010,12,24) => 'Julaften',
14
+ Date.civil(2010,12,25) => '1. juledag',
15
+ Date.civil(2010,12,26) => '2. juledag',
16
+ Date.civil(2010,12,31) => 'Nyttårsaften',
17
+ Date.civil(2010,2,14) => 'Fastelavn',
18
+ Date.civil(2010,3,28) => 'Palmesøndag',
19
+ Date.civil(2010,4,1) => 'Skjærtorsdag',
20
+ Date.civil(2010,4,2) => 'Langfredag',
21
+ Date.civil(2010,4,4) => '1. påskedag',
22
+ Date.civil(2010,4,5) => '2. påskedag',
23
+ Date.civil(2010,5,13) => 'Kristi Himmelfartsdag',
24
+ Date.civil(2010,5,23) => '1. pinsedag',
25
+ Date.civil(2010,5,24) => '2. pinsedag'}.each do |date, name|
26
+ assert_equal name, (Holidays.on(date, :no, :informal)[0] || {})[:name]
27
+ end
28
+ end
29
+ end
@@ -1,54 +1,54 @@
1
- require File.dirname(__FILE__) + '/../test_helper'
2
- require 'holidays/north_america'
3
-
4
- # This file is generated by the Ruby Holiday gem.
5
- #
6
- # Definitions loaded: data/ca.yaml, data/mx.yaml, data/us.yaml, data/north_america_informal.yaml
7
- class North_americaDefinitionTests < Test::Unit::TestCase # :nodoc:
8
-
9
- def test_north_america
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
-
29
- {Date.civil(2007,1,1) => 'Año nuevo',
30
- Date.civil(2007,2,5) => 'Día de la Constitución',
31
- Date.civil(2007,5,1) => 'Día del Trabajo',
32
- Date.civil(2007,5,5) => 'Cinco de Mayo',
33
- Date.civil(2007,9,16) => 'Día de la Independencia',
34
- Date.civil(2007,11,1) => 'Todos los Santos',
35
- Date.civil(2007,11,2) => 'Los Fieles Difuntos',
36
- Date.civil(2007,11,19) => 'Día de la Revolución',
37
- Date.civil(2007,12,25) => 'Navidad'}.each do |date, name|
38
- assert_equal name, Holidays.on(date, :mx, :informal)[0][:name]
39
- end
40
-
41
- {Date.civil(2008,1,1) => 'New Year\'s Day',
42
- Date.civil(2008,1,21) => 'Martin Luther King, Jr. Day',
43
- Date.civil(2008,2,18) => 'Presidents\' Day',
44
- Date.civil(2008,5,26) => 'Memorial Day',
45
- Date.civil(2008,7,4) => 'Independence Day',
46
- Date.civil(2008,9,1) => 'Labor Day',
47
- Date.civil(2008,10,13) => 'Columbus Day',
48
- Date.civil(2008,11,11) => 'Veterans Day',
49
- Date.civil(2008,11,27) => 'Thanksgiving',
50
- Date.civil(2008,12,25) => 'Christmas Day'}.each do |date, name|
51
- assert_equal name, Holidays.on(date, :us)[0][:name]
52
- end
53
- end
54
- 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/mx.yaml, data/us.yaml, data/north_america_informal.yaml
7
+ class North_americaDefinitionTests < Test::Unit::TestCase # :nodoc:
8
+
9
+ def test_north_america
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
+
29
+ {Date.civil(2007,1,1) => 'Año nuevo',
30
+ Date.civil(2007,2,5) => 'Día de la Constitución',
31
+ Date.civil(2007,5,1) => 'Día del Trabajo',
32
+ Date.civil(2007,5,5) => 'Cinco de Mayo',
33
+ Date.civil(2007,9,16) => 'Día de la Independencia',
34
+ Date.civil(2007,11,1) => 'Todos los Santos',
35
+ Date.civil(2007,11,2) => 'Los Fieles Difuntos',
36
+ Date.civil(2007,11,19) => 'Día de la Revolución',
37
+ Date.civil(2007,12,25) => 'Navidad'}.each do |date, name|
38
+ assert_equal name, (Holidays.on(date, :mx, :informal)[0] || {})[:name]
39
+ end
40
+
41
+ {Date.civil(2008,1,1) => 'New Year\'s Day',
42
+ Date.civil(2008,1,21) => 'Martin Luther King, Jr. Day',
43
+ Date.civil(2008,2,18) => 'Presidents\' Day',
44
+ Date.civil(2008,5,26) => 'Memorial Day',
45
+ Date.civil(2008,7,4) => 'Independence Day',
46
+ Date.civil(2008,9,1) => 'Labor Day',
47
+ Date.civil(2008,10,13) => 'Columbus Day',
48
+ Date.civil(2008,11,11) => 'Veterans Day',
49
+ Date.civil(2008,11,27) => 'Thanksgiving',
50
+ Date.civil(2008,12,25) => 'Christmas Day'}.each do |date, name|
51
+ assert_equal name, (Holidays.on(date, :us)[0] || {})[:name]
52
+ end
53
+ end
54
+ end