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_nyse.rb
CHANGED
@@ -1,22 +1,22 @@
|
|
1
|
-
|
2
|
-
require '
|
3
|
-
|
4
|
-
# This file is generated by the Ruby Holiday gem.
|
5
|
-
#
|
6
|
-
# Definitions loaded: data/nyse.yaml
|
7
|
-
class NyseDefinitionTests < Test::Unit::TestCase # :nodoc:
|
8
|
-
|
9
|
-
def test_nyse
|
10
|
-
{Date.civil(2008,1,1) => 'New Year\'s Day',
|
11
|
-
Date.civil(2008,1,21) => 'Martin Luther King, Jr. Day',
|
12
|
-
Date.civil(2008,2,18) => 'Presidents\' Day',
|
13
|
-
Date.civil(2008,3,21) => 'Good Friday',
|
14
|
-
Date.civil(2008,5,26) => 'Memorial Day',
|
15
|
-
Date.civil(2008,7,4) => 'Independence Day',
|
16
|
-
Date.civil(2008,9,1) => 'Labor Day',
|
17
|
-
Date.civil(2008,11,27) => 'Thanksgiving',
|
18
|
-
Date.civil(2008,12,25) => 'Christmas Day'}.each do |date, name|
|
19
|
-
assert_equal name, Holidays.on(date, :nyse)[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/nyse.yaml
|
7
|
+
class NyseDefinitionTests < Test::Unit::TestCase # :nodoc:
|
8
|
+
|
9
|
+
def test_nyse
|
10
|
+
{Date.civil(2008,1,1) => 'New Year\'s Day',
|
11
|
+
Date.civil(2008,1,21) => 'Martin Luther King, Jr. Day',
|
12
|
+
Date.civil(2008,2,18) => 'Presidents\' Day',
|
13
|
+
Date.civil(2008,3,21) => 'Good Friday',
|
14
|
+
Date.civil(2008,5,26) => 'Memorial Day',
|
15
|
+
Date.civil(2008,7,4) => 'Independence Day',
|
16
|
+
Date.civil(2008,9,1) => 'Labor Day',
|
17
|
+
Date.civil(2008,11,27) => 'Thanksgiving',
|
18
|
+
Date.civil(2008,12,25) => 'Christmas Day'}.each do |date, name|
|
19
|
+
assert_equal name, (Holidays.on(date, :nyse)[0] || {})[:name]
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,22 @@
|
|
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/nz.yaml
|
7
|
+
class NzDefinitionTests < Test::Unit::TestCase # :nodoc:
|
8
|
+
|
9
|
+
def test_nz
|
10
|
+
{Date.civil(2007,1,1) => 'New Year\'s Day',
|
11
|
+
Date.civil(2007,1,2) => 'Day after New Year\'s Day',
|
12
|
+
Date.civil(2007,2,6) => 'Waitangi Day',
|
13
|
+
Date.civil(2007,4,6) => 'Good Friday',
|
14
|
+
Date.civil(2007,4,9) => 'Easter Monday',
|
15
|
+
Date.civil(2007,4,25) => 'ANZAC Day',
|
16
|
+
Date.civil(2007,12,25) => 'Christmas Day',
|
17
|
+
Date.civil(2007,12,26) => 'Boxing Day'}.each do |date, name|
|
18
|
+
assert_equal name, (Holidays.on(date, :nz, :informal)[0] || {})[:name]
|
19
|
+
end
|
20
|
+
|
21
|
+
end
|
22
|
+
end
|
data/test/defs/test_defs_pt.rb
CHANGED
@@ -1,32 +1,32 @@
|
|
1
|
-
|
2
|
-
require '
|
3
|
-
|
4
|
-
# This file is generated by the Ruby Holiday gem.
|
5
|
-
#
|
6
|
-
# Definitions loaded: data/
|
7
|
-
class PtDefinitionTests < Test::Unit::TestCase # :nodoc:
|
8
|
-
|
9
|
-
def test_pt
|
10
|
-
{Date.civil(2008,1,1) => '
|
11
|
-
Date.civil(
|
12
|
-
Date.civil(
|
13
|
-
Date.civil(
|
14
|
-
Date.civil(2008,
|
15
|
-
Date.civil(2008,
|
16
|
-
Date.civil(2008,
|
17
|
-
Date.civil(2008,
|
18
|
-
Date.civil(2008,
|
19
|
-
Date.civil(2005,
|
20
|
-
Date.civil(
|
21
|
-
Date.civil(
|
22
|
-
Date.civil(2008,6,
|
23
|
-
Date.civil(
|
24
|
-
Date.civil(
|
25
|
-
Date.civil(
|
26
|
-
Date.civil(2008,
|
27
|
-
Date.civil(2008,12,
|
28
|
-
Date.civil(2008,12,
|
29
|
-
assert_equal name, Holidays.on(date, :
|
30
|
-
end
|
31
|
-
end
|
32
|
-
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/pt.yaml
|
7
|
+
class PtDefinitionTests < Test::Unit::TestCase # :nodoc:
|
8
|
+
|
9
|
+
def test_pt
|
10
|
+
{Date.civil(2008,1,1) => 'Ano Novo',
|
11
|
+
Date.civil(2005,2,8) => 'Carnaval',
|
12
|
+
Date.civil(2006,2,28) => 'Carnaval',
|
13
|
+
Date.civil(2007,2,20) => 'Carnaval',
|
14
|
+
Date.civil(2008,2,5) => 'Carnaval',
|
15
|
+
Date.civil(2008,3,21) => 'Sexta-feira Santa',
|
16
|
+
Date.civil(2008,3,23) => 'Páscoa',
|
17
|
+
Date.civil(2008,4,25) => 'Dia da Liberdade',
|
18
|
+
Date.civil(2008,5,1) => 'Dia do Trabalhador',
|
19
|
+
Date.civil(2005,5,26) => 'Corpo de Deus',
|
20
|
+
Date.civil(2007,6,7) => 'Corpo de Deus',
|
21
|
+
Date.civil(2008,5,22) => 'Corpo de Deus',
|
22
|
+
Date.civil(2008,6,10) => 'Dia de Portugal',
|
23
|
+
Date.civil(2008,8,15) => 'Assunção de Nossa Senhora',
|
24
|
+
Date.civil(2008,10,5) => 'Implantação da República',
|
25
|
+
Date.civil(2008,11,1) => 'Todos os Santos',
|
26
|
+
Date.civil(2008,12,1) => 'Restauração da Independência',
|
27
|
+
Date.civil(2008,12,8) => 'Imaculada Conceição',
|
28
|
+
Date.civil(2008,12,25) => 'Natal'}.each do |date, name|
|
29
|
+
assert_equal name, (Holidays.on(date, :pt, :informal)[0] || {})[:name]
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
@@ -1,75 +1,94 @@
|
|
1
|
-
|
2
|
-
require '
|
3
|
-
|
4
|
-
# This file is generated by the Ruby Holiday gem.
|
5
|
-
#
|
6
|
-
# Definitions loaded: data/dk.yaml, data/is.yaml, data/se.yaml
|
7
|
-
class ScandinaviaDefinitionTests < Test::Unit::TestCase # :nodoc:
|
8
|
-
|
9
|
-
def test_scandinavia
|
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(2007,1,1) => 'Nýársdagur',
|
31
|
-
Date.civil(2007,1,6) => 'Þrettándinn',
|
32
|
-
Date.civil(2007,1,19) => 'Bóndadagur',
|
33
|
-
Date.civil(2007,2,18) => 'Konudagur',
|
34
|
-
Date.civil(2007,4,5) => 'Skírdagur',
|
35
|
-
Date.civil(2007,4,6) => 'Föstudaginn langi',
|
36
|
-
Date.civil(2007,4,8) => 'Páskadagur',
|
37
|
-
Date.civil(2007,4,9) => 'Annar í páskum',
|
38
|
-
Date.civil(2007,4,19) => 'Sumardagurinn fyrsti',
|
39
|
-
Date.civil(2007,5,1) => 'Verkalýðsdagurinn',
|
40
|
-
Date.civil(2007,5,17) => 'Uppstigningardagur',
|
41
|
-
Date.civil(2007,5,27) => 'Hvítasunnudagur',
|
42
|
-
Date.civil(2007,5,28) => 'Annar í hvítasunnu',
|
43
|
-
Date.civil(2007,6,3) => 'Sjómannadagurinn',
|
44
|
-
Date.civil(2007,6,17) => 'Lýðveldisdagurinn',
|
45
|
-
Date.civil(2007,8,6) => 'Frídagur verslunarmanna',
|
46
|
-
Date.civil(2007,12,24) => 'Jól',
|
47
|
-
Date.civil(2007,12,25) => 'Jól',
|
48
|
-
Date.civil(2007,12,26) => 'Jól',
|
49
|
-
Date.civil(2007,12,31) => 'Gamlárskvöld'}.each do |date, name|
|
50
|
-
assert_equal name, Holidays.on(date, :is, :informal)[0][:name]
|
51
|
-
end
|
52
|
-
|
53
|
-
{Date.civil(
|
54
|
-
Date.civil(
|
55
|
-
Date.civil(
|
56
|
-
Date.civil(
|
57
|
-
Date.civil(
|
58
|
-
Date.civil(
|
59
|
-
Date.civil(
|
60
|
-
Date.civil(
|
61
|
-
Date.civil(
|
62
|
-
Date.civil(
|
63
|
-
Date.civil(
|
64
|
-
Date.civil(
|
65
|
-
Date.civil(
|
66
|
-
Date.civil(
|
67
|
-
Date.civil(
|
68
|
-
Date.civil(
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
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, data/is.yaml, data/no.yaml, data/se.yaml
|
7
|
+
class ScandinaviaDefinitionTests < Test::Unit::TestCase # :nodoc:
|
8
|
+
|
9
|
+
def test_scandinavia
|
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(2007,1,1) => 'Nýársdagur',
|
31
|
+
Date.civil(2007,1,6) => 'Þrettándinn',
|
32
|
+
Date.civil(2007,1,19) => 'Bóndadagur',
|
33
|
+
Date.civil(2007,2,18) => 'Konudagur',
|
34
|
+
Date.civil(2007,4,5) => 'Skírdagur',
|
35
|
+
Date.civil(2007,4,6) => 'Föstudaginn langi',
|
36
|
+
Date.civil(2007,4,8) => 'Páskadagur',
|
37
|
+
Date.civil(2007,4,9) => 'Annar í páskum',
|
38
|
+
Date.civil(2007,4,19) => 'Sumardagurinn fyrsti',
|
39
|
+
Date.civil(2007,5,1) => 'Verkalýðsdagurinn',
|
40
|
+
Date.civil(2007,5,17) => 'Uppstigningardagur',
|
41
|
+
Date.civil(2007,5,27) => 'Hvítasunnudagur',
|
42
|
+
Date.civil(2007,5,28) => 'Annar í hvítasunnu',
|
43
|
+
Date.civil(2007,6,3) => 'Sjómannadagurinn',
|
44
|
+
Date.civil(2007,6,17) => 'Lýðveldisdagurinn',
|
45
|
+
Date.civil(2007,8,6) => 'Frídagur verslunarmanna',
|
46
|
+
Date.civil(2007,12,24) => 'Jól',
|
47
|
+
Date.civil(2007,12,25) => 'Jól',
|
48
|
+
Date.civil(2007,12,26) => 'Jól',
|
49
|
+
Date.civil(2007,12,31) => 'Gamlárskvöld'}.each do |date, name|
|
50
|
+
assert_equal name, (Holidays.on(date, :is, :informal)[0] || {})[:name]
|
51
|
+
end
|
52
|
+
|
53
|
+
{Date.civil(2010,1,1) => 'Nyttårsdag',
|
54
|
+
Date.civil(2010,5,1) => '1. mai',
|
55
|
+
Date.civil(2010,5,17) => '17. mai',
|
56
|
+
Date.civil(2010,12,24) => 'Julaften',
|
57
|
+
Date.civil(2010,12,25) => '1. juledag',
|
58
|
+
Date.civil(2010,12,26) => '2. juledag',
|
59
|
+
Date.civil(2010,12,31) => 'Nyttårsaften',
|
60
|
+
Date.civil(2010,2,14) => 'Fastelavn',
|
61
|
+
Date.civil(2010,3,28) => 'Palmesøndag',
|
62
|
+
Date.civil(2010,4,1) => 'Skjærtorsdag',
|
63
|
+
Date.civil(2010,4,2) => 'Langfredag',
|
64
|
+
Date.civil(2010,4,4) => '1. påskedag',
|
65
|
+
Date.civil(2010,4,5) => '2. påskedag',
|
66
|
+
Date.civil(2010,5,13) => 'Kristi Himmelfartsdag',
|
67
|
+
Date.civil(2010,5,23) => '1. pinsedag',
|
68
|
+
Date.civil(2010,5,24) => '2. pinsedag'}.each do |date, name|
|
69
|
+
assert_equal name, (Holidays.on(date, :no, :informal)[0] || {})[:name]
|
70
|
+
end
|
71
|
+
|
72
|
+
{Date.civil(2008,1,1) => 'Nyårsdagen',
|
73
|
+
Date.civil(2008,1,6) => 'Trettondedag jul',
|
74
|
+
Date.civil(2008,3,21) => 'Långfredagen',
|
75
|
+
Date.civil(2008,3,23) => 'Påskdagen',
|
76
|
+
Date.civil(2008,3,24) => 'Annandag påsk',
|
77
|
+
Date.civil(2008,5,1) => 'Första maj',
|
78
|
+
Date.civil(2008,5,1) => 'Kristi himmelsfärdsdag',
|
79
|
+
Date.civil(2008,5,11) => 'Pingstdagen',
|
80
|
+
Date.civil(2008,6,6) => 'Nationaldagen',
|
81
|
+
Date.civil(2005,6,25) => 'Midsommardagen',
|
82
|
+
Date.civil(2006,6,24) => 'Midsommardagen',
|
83
|
+
Date.civil(2007,6,23) => 'Midsommardagen',
|
84
|
+
Date.civil(2008,6,21) => 'Midsommardagen',
|
85
|
+
Date.civil(2005,11,5) => 'Alla helgons dag',
|
86
|
+
Date.civil(2006,11,4) => 'Alla helgons dag',
|
87
|
+
Date.civil(2007,11,3) => 'Alla helgons dag',
|
88
|
+
Date.civil(2008,11,1) => 'Alla helgons dag',
|
89
|
+
Date.civil(2008,12,25) => 'Juldagen',
|
90
|
+
Date.civil(2008,12,26) => 'Annandag jul'}.each do |date, name|
|
91
|
+
assert_equal name, (Holidays.on(date, :se, :informal)[0] || {})[:name]
|
92
|
+
end
|
93
|
+
end
|
94
|
+
end
|
data/test/defs/test_defs_se.rb
CHANGED
@@ -1,32 +1,32 @@
|
|
1
|
-
|
2
|
-
require '
|
3
|
-
|
4
|
-
# This file is generated by the Ruby Holiday gem.
|
5
|
-
#
|
6
|
-
# Definitions loaded: data/se.yaml
|
7
|
-
class SeDefinitionTests < Test::Unit::TestCase # :nodoc:
|
8
|
-
|
9
|
-
def test_se
|
10
|
-
{Date.civil(2008,1,1) => 'Nyårsdagen',
|
11
|
-
Date.civil(2008,1,6) => 'Trettondedag jul',
|
12
|
-
Date.civil(2008,3,21) => 'Långfredagen',
|
13
|
-
Date.civil(2008,3,23) => 'Påskdagen',
|
14
|
-
Date.civil(2008,3,24) => 'Annandag påsk',
|
15
|
-
Date.civil(2008,5,1) => 'Första maj',
|
16
|
-
Date.civil(2008,5,1) => 'Kristi himmelsfärdsdag',
|
17
|
-
Date.civil(2008,5,11) => 'Pingstdagen',
|
18
|
-
Date.civil(2008,6,6) => 'Nationaldagen',
|
19
|
-
Date.civil(2005,6,25) => 'Midsommardagen',
|
20
|
-
Date.civil(2006,6,24) => 'Midsommardagen',
|
21
|
-
Date.civil(2007,6,23) => 'Midsommardagen',
|
22
|
-
Date.civil(2008,6,21) => 'Midsommardagen',
|
23
|
-
Date.civil(2005,11,5) => 'Alla helgons dag',
|
24
|
-
Date.civil(2006,11,4) => 'Alla helgons dag',
|
25
|
-
Date.civil(2007,11,3) => 'Alla helgons dag',
|
26
|
-
Date.civil(2008,11,1) => 'Alla helgons dag',
|
27
|
-
Date.civil(2008,12,25) => 'Juldagen',
|
28
|
-
Date.civil(2008,12,26) => 'Annandag jul'}.each do |date, name|
|
29
|
-
assert_equal name, Holidays.on(date, :se, :informal)[0][:name]
|
30
|
-
end
|
31
|
-
end
|
32
|
-
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/se.yaml
|
7
|
+
class SeDefinitionTests < Test::Unit::TestCase # :nodoc:
|
8
|
+
|
9
|
+
def test_se
|
10
|
+
{Date.civil(2008,1,1) => 'Nyårsdagen',
|
11
|
+
Date.civil(2008,1,6) => 'Trettondedag jul',
|
12
|
+
Date.civil(2008,3,21) => 'Långfredagen',
|
13
|
+
Date.civil(2008,3,23) => 'Påskdagen',
|
14
|
+
Date.civil(2008,3,24) => 'Annandag påsk',
|
15
|
+
Date.civil(2008,5,1) => 'Första maj',
|
16
|
+
Date.civil(2008,5,1) => 'Kristi himmelsfärdsdag',
|
17
|
+
Date.civil(2008,5,11) => 'Pingstdagen',
|
18
|
+
Date.civil(2008,6,6) => 'Nationaldagen',
|
19
|
+
Date.civil(2005,6,25) => 'Midsommardagen',
|
20
|
+
Date.civil(2006,6,24) => 'Midsommardagen',
|
21
|
+
Date.civil(2007,6,23) => 'Midsommardagen',
|
22
|
+
Date.civil(2008,6,21) => 'Midsommardagen',
|
23
|
+
Date.civil(2005,11,5) => 'Alla helgons dag',
|
24
|
+
Date.civil(2006,11,4) => 'Alla helgons dag',
|
25
|
+
Date.civil(2007,11,3) => 'Alla helgons dag',
|
26
|
+
Date.civil(2008,11,1) => 'Alla helgons dag',
|
27
|
+
Date.civil(2008,12,25) => 'Juldagen',
|
28
|
+
Date.civil(2008,12,26) => 'Annandag jul'}.each do |date, name|
|
29
|
+
assert_equal name, (Holidays.on(date, :se, :informal)[0] || {})[:name]
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
data/test/defs/test_defs_ups.rb
CHANGED
@@ -1,21 +1,21 @@
|
|
1
|
-
|
2
|
-
require '
|
3
|
-
|
4
|
-
# This file is generated by the Ruby Holiday gem.
|
5
|
-
#
|
6
|
-
# Definitions loaded: data/ups.yaml
|
7
|
-
class UpsDefinitionTests < Test::Unit::TestCase # :nodoc:
|
8
|
-
|
9
|
-
def test_ups
|
10
|
-
{Date.civil(2008,1,1) => 'New Year\'s Day',
|
11
|
-
Date.civil(2008,5,26) => 'Memorial Day',
|
12
|
-
Date.civil(2008,7,4) => 'Independence Day',
|
13
|
-
Date.civil(2008,9,1) => 'Labor Day',
|
14
|
-
Date.civil(2008,11,27) => 'Thanksgiving',
|
15
|
-
Date.civil(2008,11,28) => 'Day After Thanksgiving',
|
16
|
-
Date.civil(2008,12,25) => 'Christmas Day',
|
17
|
-
Date.civil(2008,12,31) => 'New Year\'s Eve',}.each do |date, name|
|
18
|
-
assert_equal name, Holidays.on(date, :ups)[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/ups.yaml
|
7
|
+
class UpsDefinitionTests < Test::Unit::TestCase # :nodoc:
|
8
|
+
|
9
|
+
def test_ups
|
10
|
+
{Date.civil(2008,1,1) => 'New Year\'s Day',
|
11
|
+
Date.civil(2008,5,26) => 'Memorial Day',
|
12
|
+
Date.civil(2008,7,4) => 'Independence Day',
|
13
|
+
Date.civil(2008,9,1) => 'Labor Day',
|
14
|
+
Date.civil(2008,11,27) => 'Thanksgiving',
|
15
|
+
Date.civil(2008,11,28) => 'Day After Thanksgiving',
|
16
|
+
Date.civil(2008,12,25) => 'Christmas Day',
|
17
|
+
Date.civil(2008,12,31) => 'New Year\'s Eve',}.each do |date, name|
|
18
|
+
assert_equal name, (Holidays.on(date, :ups)[0] || {})[:name]
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
data/test/defs/test_defs_us.rb
CHANGED
@@ -1,23 +1,23 @@
|
|
1
|
-
|
2
|
-
require '
|
3
|
-
|
4
|
-
# This file is generated by the Ruby Holiday gem.
|
5
|
-
#
|
6
|
-
# Definitions loaded: data/us.yaml, data/north_america_informal.yaml
|
7
|
-
class UsDefinitionTests < Test::Unit::TestCase # :nodoc:
|
8
|
-
|
9
|
-
def test_us
|
10
|
-
{Date.civil(2008,1,1) => 'New Year\'s Day',
|
11
|
-
Date.civil(2008,1,21) => 'Martin Luther King, Jr. Day',
|
12
|
-
Date.civil(2008,2,18) => 'Presidents\' Day',
|
13
|
-
Date.civil(2008,5,26) => 'Memorial Day',
|
14
|
-
Date.civil(2008,7,4) => 'Independence Day',
|
15
|
-
Date.civil(2008,9,1) => 'Labor Day',
|
16
|
-
Date.civil(2008,10,13) => 'Columbus Day',
|
17
|
-
Date.civil(2008,11,11) => 'Veterans Day',
|
18
|
-
Date.civil(2008,11,27) => 'Thanksgiving',
|
19
|
-
Date.civil(2008,12,25) => 'Christmas Day'}.each do |date, name|
|
20
|
-
assert_equal name, Holidays.on(date, :us)[0][:name]
|
21
|
-
end
|
22
|
-
end
|
23
|
-
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/us.yaml, data/north_america_informal.yaml
|
7
|
+
class UsDefinitionTests < Test::Unit::TestCase # :nodoc:
|
8
|
+
|
9
|
+
def test_us
|
10
|
+
{Date.civil(2008,1,1) => 'New Year\'s Day',
|
11
|
+
Date.civil(2008,1,21) => 'Martin Luther King, Jr. Day',
|
12
|
+
Date.civil(2008,2,18) => 'Presidents\' Day',
|
13
|
+
Date.civil(2008,5,26) => 'Memorial Day',
|
14
|
+
Date.civil(2008,7,4) => 'Independence Day',
|
15
|
+
Date.civil(2008,9,1) => 'Labor Day',
|
16
|
+
Date.civil(2008,10,13) => 'Columbus Day',
|
17
|
+
Date.civil(2008,11,11) => 'Veterans Day',
|
18
|
+
Date.civil(2008,11,27) => 'Thanksgiving',
|
19
|
+
Date.civil(2008,12,25) => 'Christmas Day'}.each do |date, name|
|
20
|
+
assert_equal name, (Holidays.on(date, :us)[0] || {})[:name]
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|