holidays 2.2.0 → 3.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +11 -0
- data/README.md +22 -8
- data/Rakefile +26 -8
- data/bin/console +7 -0
- data/bin/setup +5 -0
- data/{data → definitions}/SYNTAX.rdoc +0 -0
- data/{data → definitions}/ar.yaml +0 -0
- data/{data → definitions}/at.yaml +1 -1
- data/{data → definitions}/au.yaml +80 -51
- data/{data → definitions}/be.yaml +0 -0
- data/{data → definitions}/br.yaml +0 -0
- data/{data → definitions}/ca.yaml +0 -0
- data/{data → definitions}/ch.yaml +0 -0
- data/{data → definitions}/cl.yaml +0 -0
- data/{data → definitions}/cr.yaml +0 -0
- data/{data → definitions}/cz.yaml +0 -0
- data/{data → definitions}/de.yaml +25 -34
- data/{data → definitions}/dk.yaml +0 -0
- data/{data → definitions}/ecb_target.yaml +2 -2
- data/{data → definitions}/el.yaml +0 -0
- data/{data → definitions}/es.yaml +37 -26
- data/{data → definitions}/federal_reserve.yaml +0 -0
- data/{data → definitions}/fedex.yaml +9 -3
- data/{data → definitions}/fi.yaml +0 -0
- data/{data → definitions}/fr.yaml +0 -0
- data/{data → definitions}/gb.yaml +19 -19
- data/{data → definitions}/hr.yaml +0 -0
- data/{data → definitions}/hu.yaml +1 -1
- data/{data → definitions}/ie.yaml +0 -0
- data/{data → definitions}/index.yaml +0 -0
- data/{data → definitions}/is.yaml +0 -0
- data/{data → definitions}/it.yaml +0 -0
- data/{data → definitions}/jp.yaml +3 -3
- data/{data → definitions}/li.yaml +3 -3
- data/{data → definitions}/lt.yaml +0 -0
- data/{data → definitions}/ma.yaml +0 -0
- data/{data → definitions}/mx.yaml +0 -0
- data/{data → definitions}/nerc.yaml +0 -0
- data/{data → definitions}/nl.yaml +0 -0
- data/{data → definitions}/no.yaml +0 -0
- data/{data → definitions}/north_america_informal.yaml +0 -0
- data/{data → definitions}/nyse.yaml +0 -0
- data/{data → definitions}/nz.yaml +21 -10
- data/{data → definitions}/ph.yaml +0 -0
- data/{data → definitions}/pl.yaml +0 -0
- data/{data → definitions}/pt.yaml +0 -0
- data/{data → definitions}/ro.yaml +1 -2
- data/{data → definitions}/se.yaml +0 -0
- data/{data → definitions}/sg.yaml +0 -0
- data/{data → definitions}/si.yaml +6 -6
- data/{data → definitions}/sk.yaml +0 -0
- data/{data → definitions}/united_nations.yaml +0 -0
- data/{data → definitions}/ups.yaml +17 -11
- data/{data → definitions}/us.yaml +20 -15
- data/{data → definitions}/ve.yaml +0 -0
- data/{data → definitions}/vi.yaml +0 -0
- data/{data → definitions}/za.yaml +0 -0
- data/holidays.gemspec +2 -1
- data/lib/generated_definitions/MANIFEST +56 -0
- data/lib/generated_definitions/REGIONS.rb +4 -0
- data/lib/{holidays → generated_definitions}/ar.rb +2 -2
- data/lib/{holidays → generated_definitions}/at.rb +2 -2
- data/lib/{holidays → generated_definitions}/au.rb +19 -10
- data/lib/{holidays → generated_definitions}/be.rb +2 -2
- data/lib/{holidays → generated_definitions}/br.rb +2 -2
- data/lib/{holidays → generated_definitions}/ca.rb +2 -2
- data/lib/{holidays → generated_definitions}/ch.rb +2 -2
- data/lib/{holidays → generated_definitions}/cl.rb +2 -2
- data/lib/{holidays → generated_definitions}/cr.rb +2 -2
- data/lib/{holidays → generated_definitions}/cz.rb +2 -2
- data/lib/{holidays → generated_definitions}/de.rb +5 -4
- data/lib/{holidays → generated_definitions}/dk.rb +2 -2
- data/lib/{holidays → generated_definitions}/ecb_target.rb +2 -2
- data/lib/{holidays → generated_definitions}/el.rb +2 -2
- data/lib/{holidays → generated_definitions}/es.rb +6 -6
- data/lib/{holidays → generated_definitions}/europe.rb +7 -6
- data/lib/{holidays → generated_definitions}/fed_ex.rb +8 -3
- data/lib/{holidays → generated_definitions}/federal_reserve.rb +2 -2
- data/lib/{holidays → generated_definitions}/fi.rb +2 -2
- data/lib/{holidays → generated_definitions}/fr.rb +2 -2
- data/lib/{holidays → generated_definitions}/gb.rb +2 -2
- data/lib/{holidays → generated_definitions}/hr.rb +2 -2
- data/lib/{holidays → generated_definitions}/hu.rb +2 -2
- data/lib/{holidays → generated_definitions}/ie.rb +2 -2
- data/lib/{holidays → generated_definitions}/is.rb +2 -2
- data/lib/{holidays → generated_definitions}/it.rb +2 -2
- data/lib/{holidays → generated_definitions}/jp.rb +5 -5
- data/lib/{holidays → generated_definitions}/li.rb +2 -2
- data/lib/{holidays → generated_definitions}/lt.rb +2 -2
- data/lib/{holidays → generated_definitions}/ma.rb +2 -2
- data/lib/{holidays → generated_definitions}/mx.rb +2 -2
- data/lib/{holidays → generated_definitions}/nerc.rb +2 -2
- data/lib/{holidays → generated_definitions}/nl.rb +2 -2
- data/lib/{holidays → generated_definitions}/no.rb +2 -2
- data/lib/{holidays → generated_definitions}/north_america.rb +8 -3
- data/lib/{holidays → generated_definitions}/nyse.rb +2 -2
- data/lib/{holidays → generated_definitions}/nz.rb +5 -5
- data/lib/{holidays → generated_definitions}/ph.rb +2 -2
- data/lib/{holidays → generated_definitions}/pl.rb +2 -2
- data/lib/{holidays → generated_definitions}/pt.rb +2 -2
- data/lib/{holidays → generated_definitions}/ro.rb +2 -2
- data/lib/{holidays → generated_definitions}/scandinavia.rb +2 -2
- data/lib/{holidays → generated_definitions}/se.rb +2 -2
- data/lib/{holidays → generated_definitions}/sg.rb +2 -2
- data/lib/{holidays → generated_definitions}/si.rb +2 -2
- data/lib/{holidays → generated_definitions}/sk.rb +2 -2
- data/lib/{holidays → generated_definitions}/united_nations.rb +2 -2
- data/lib/{holidays → generated_definitions}/ups.rb +8 -3
- data/lib/{holidays → generated_definitions}/us.rb +8 -3
- data/lib/{holidays → generated_definitions}/ve.rb +2 -2
- data/lib/{holidays → generated_definitions}/vi.rb +2 -2
- data/lib/{holidays → generated_definitions}/za.rb +2 -2
- data/lib/holidays.rb +120 -665
- data/lib/holidays/core_extensions/date.rb +39 -0
- data/lib/holidays/date_calculator/day_of_month.rb +68 -0
- data/lib/holidays/date_calculator/easter.rb +58 -0
- data/lib/holidays/date_calculator/weekend_modifier.rb +49 -0
- data/lib/holidays/date_calculator_factory.rb +21 -0
- data/lib/holidays/definition/context/generator.rb +216 -0
- data/lib/holidays/definition/context/merger.rb +26 -0
- data/lib/holidays/definition/repository/cache.rb +33 -0
- data/lib/holidays/definition/repository/holidays_by_month.rb +49 -0
- data/lib/holidays/definition/repository/proc_cache.rb +36 -0
- data/lib/holidays/definition/repository/regions.rb +36 -0
- data/lib/holidays/definition/validator/region.rb +45 -0
- data/lib/holidays/definition_factory.rb +50 -0
- data/lib/holidays/option/context/parse_options.rb +96 -0
- data/lib/holidays/option_factory.rb +14 -0
- data/lib/holidays/use_case/context/between.rb +105 -0
- data/lib/holidays/use_case/context/dates_driver_builder.rb +64 -0
- data/lib/holidays/use_case_factory.rb +20 -0
- data/lib/holidays/version.rb +1 -1
- data/test/defs/test_defs_ar.rb +1 -1
- data/test/defs/test_defs_at.rb +2 -2
- data/test/defs/test_defs_au.rb +61 -43
- data/test/defs/test_defs_be.rb +1 -1
- data/test/defs/test_defs_br.rb +1 -1
- data/test/defs/test_defs_ca.rb +1 -1
- data/test/defs/test_defs_ch.rb +1 -1
- data/test/defs/test_defs_cl.rb +1 -1
- data/test/defs/test_defs_cr.rb +1 -1
- data/test/defs/test_defs_cz.rb +1 -1
- data/test/defs/test_defs_de.rb +18 -30
- data/test/defs/test_defs_dk.rb +1 -1
- data/test/defs/test_defs_ecb_target.rb +3 -3
- data/test/defs/test_defs_el.rb +1 -1
- data/test/defs/test_defs_es.rb +36 -25
- data/test/defs/test_defs_europe.rb +82 -84
- data/test/defs/test_defs_fed_ex.rb +4 -1
- data/test/defs/test_defs_federal_reserve.rb +1 -1
- data/test/defs/test_defs_fi.rb +1 -1
- data/test/defs/test_defs_fr.rb +1 -1
- data/test/defs/test_defs_gb.rb +20 -20
- data/test/defs/test_defs_hr.rb +1 -1
- data/test/defs/test_defs_hu.rb +2 -2
- data/test/defs/test_defs_ie.rb +1 -1
- data/test/defs/test_defs_is.rb +1 -1
- data/test/defs/test_defs_it.rb +1 -1
- data/test/defs/test_defs_jp.rb +1 -1
- data/test/defs/test_defs_li.rb +4 -4
- data/test/defs/test_defs_lt.rb +1 -1
- data/test/defs/test_defs_ma.rb +1 -1
- data/test/defs/test_defs_mx.rb +1 -1
- data/test/defs/test_defs_nerc.rb +1 -1
- data/test/defs/test_defs_nl.rb +1 -1
- data/test/defs/test_defs_no.rb +1 -1
- data/test/defs/test_defs_north_america.rb +5 -3
- data/test/defs/test_defs_nyse.rb +1 -1
- data/test/defs/test_defs_nz.rb +19 -9
- data/test/defs/test_defs_ph.rb +1 -1
- data/test/defs/test_defs_pl.rb +1 -1
- data/test/defs/test_defs_pt.rb +1 -1
- data/test/defs/test_defs_ro.rb +2 -3
- data/test/defs/test_defs_scandinavia.rb +1 -1
- data/test/defs/test_defs_se.rb +1 -1
- data/test/defs/test_defs_sg.rb +1 -1
- data/test/defs/test_defs_si.rb +7 -7
- data/test/defs/test_defs_sk.rb +1 -1
- data/test/defs/test_defs_united_nations.rb +1 -1
- data/test/defs/test_defs_ups.rb +5 -2
- data/test/defs/test_defs_us.rb +5 -3
- data/test/defs/test_defs_ve.rb +1 -1
- data/test/defs/test_defs_vi.rb +1 -1
- data/test/defs/test_defs_za.rb +1 -1
- data/test/{test_date.rb → holidays/core_extensions/test_date.rb} +8 -2
- data/test/holidays/date_calculator/test_day_of_month.rb +27 -0
- data/test/holidays/date_calculator/test_easter.rb +29 -0
- data/test/holidays/date_calculator/test_weekend_modifier.rb +33 -0
- data/test/holidays/definition/context/test_generator.rb +84 -0
- data/test/holidays/definition/context/test_merger.rb +22 -0
- data/test/holidays/definition/repository/test_cache.rb +82 -0
- data/test/holidays/definition/repository/test_holidays_by_month.rb +187 -0
- data/test/holidays/definition/repository/test_proc_cache.rb +29 -0
- data/test/holidays/definition/repository/test_regions.rb +86 -0
- data/test/holidays/definition/validator/test_region.rb +50 -0
- data/test/holidays/option/context/test_parse_options.rb +69 -0
- data/test/holidays/test_date_calculator_factory.rb +21 -0
- data/test/holidays/test_definition_factory.rb +34 -0
- data/test/holidays/test_option_factory.rb +9 -0
- data/test/holidays/test_use_case_factory.rb +13 -0
- data/test/holidays/use_case/context/test_between.rb +75 -0
- data/test/holidays/use_case/context/test_dates_driver_builder.rb +91 -0
- data/test/test_all_regions.rb +14 -3
- data/test/test_helper.rb +2 -1
- data/test/test_holidays.rb +19 -24
- data/test/test_holidays_between.rb +85 -0
- data/test/test_multiple_regions.rb +2 -2
- data/test/test_parse_definitions.rb +10 -4
- metadata +181 -111
- data/.coveralls.yml +0 -1
- data/lib/holidays/MANIFEST +0 -55
data/test/defs/test_defs_hr.rb
CHANGED
@@ -3,7 +3,7 @@ require File.expand_path(File.dirname(__FILE__)) + '/../test_helper'
|
|
3
3
|
|
4
4
|
# This file is generated by the Ruby Holiday gem.
|
5
5
|
#
|
6
|
-
# Definitions loaded:
|
6
|
+
# Definitions loaded: definitions/hr.yaml
|
7
7
|
class HrDefinitionTests < Test::Unit::TestCase # :nodoc:
|
8
8
|
|
9
9
|
def test_hr
|
data/test/defs/test_defs_hu.rb
CHANGED
@@ -3,7 +3,7 @@ require File.expand_path(File.dirname(__FILE__)) + '/../test_helper'
|
|
3
3
|
|
4
4
|
# This file is generated by the Ruby Holiday gem.
|
5
5
|
#
|
6
|
-
# Definitions loaded:
|
6
|
+
# Definitions loaded: definitions/hu.yaml
|
7
7
|
class HuDefinitionTests < Test::Unit::TestCase # :nodoc:
|
8
8
|
|
9
9
|
def test_hu
|
@@ -23,7 +23,7 @@ class HuDefinitionTests < Test::Unit::TestCase # :nodoc:
|
|
23
23
|
assert_equal name, (Holidays.on(date, :hu, :informal)[0] || {})[:name]
|
24
24
|
end
|
25
25
|
|
26
|
-
|
26
|
+
assert_equal [], Holidays.on(Date.civil(2012,3,14), :hu), '2012-03-14 is not a holiday in Hungary'
|
27
27
|
|
28
28
|
end
|
29
29
|
end
|
data/test/defs/test_defs_ie.rb
CHANGED
@@ -3,7 +3,7 @@ require File.expand_path(File.dirname(__FILE__)) + '/../test_helper'
|
|
3
3
|
|
4
4
|
# This file is generated by the Ruby Holiday gem.
|
5
5
|
#
|
6
|
-
# Definitions loaded:
|
6
|
+
# Definitions loaded: definitions/ie.yaml
|
7
7
|
class IeDefinitionTests < Test::Unit::TestCase # :nodoc:
|
8
8
|
|
9
9
|
def test_ie
|
data/test/defs/test_defs_is.rb
CHANGED
@@ -3,7 +3,7 @@ require File.expand_path(File.dirname(__FILE__)) + '/../test_helper'
|
|
3
3
|
|
4
4
|
# This file is generated by the Ruby Holiday gem.
|
5
5
|
#
|
6
|
-
# Definitions loaded:
|
6
|
+
# Definitions loaded: definitions/is.yaml
|
7
7
|
class IsDefinitionTests < Test::Unit::TestCase # :nodoc:
|
8
8
|
|
9
9
|
def test_is
|
data/test/defs/test_defs_it.rb
CHANGED
@@ -3,7 +3,7 @@ require File.expand_path(File.dirname(__FILE__)) + '/../test_helper'
|
|
3
3
|
|
4
4
|
# This file is generated by the Ruby Holiday gem.
|
5
5
|
#
|
6
|
-
# Definitions loaded:
|
6
|
+
# Definitions loaded: definitions/it.yaml
|
7
7
|
class ItDefinitionTests < Test::Unit::TestCase # :nodoc:
|
8
8
|
|
9
9
|
def test_it
|
data/test/defs/test_defs_jp.rb
CHANGED
@@ -3,7 +3,7 @@ require File.expand_path(File.dirname(__FILE__)) + '/../test_helper'
|
|
3
3
|
|
4
4
|
# This file is generated by the Ruby Holiday gem.
|
5
5
|
#
|
6
|
-
# Definitions loaded:
|
6
|
+
# Definitions loaded: definitions/jp.yaml
|
7
7
|
class JpDefinitionTests < Test::Unit::TestCase # :nodoc:
|
8
8
|
|
9
9
|
def test_jp
|
data/test/defs/test_defs_li.rb
CHANGED
@@ -3,7 +3,7 @@ require File.expand_path(File.dirname(__FILE__)) + '/../test_helper'
|
|
3
3
|
|
4
4
|
# This file is generated by the Ruby Holiday gem.
|
5
5
|
#
|
6
|
-
# Definitions loaded:
|
6
|
+
# Definitions loaded: definitions/li.yaml
|
7
7
|
class LiDefinitionTests < Test::Unit::TestCase # :nodoc:
|
8
8
|
|
9
9
|
def test_li
|
@@ -20,15 +20,15 @@ class LiDefinitionTests < Test::Unit::TestCase # :nodoc:
|
|
20
20
|
end
|
21
21
|
|
22
22
|
[:li].each do |r|
|
23
|
-
assert_equal 'Fronleichnam', Date.civil(2009,6,11)
|
23
|
+
assert_equal 'Fronleichnam', Holidays.on(Date.civil(2009,6,11), r)[0][:name]
|
24
24
|
end
|
25
25
|
|
26
26
|
[:li].each do |r|
|
27
|
-
assert_equal 'Staatsfeiertag', Date.civil(2009,8,15)
|
27
|
+
assert_equal 'Staatsfeiertag', Holidays.on(Date.civil(2009,8,15), r)[0][:name]
|
28
28
|
end
|
29
29
|
|
30
30
|
[:li].each do |r|
|
31
|
-
assert_equal 'Allerheiligen', Date.civil(2009,11,1)
|
31
|
+
assert_equal 'Allerheiligen', Holidays.on(Date.civil(2009,11,1), r)[0][:name]
|
32
32
|
end
|
33
33
|
|
34
34
|
end
|
data/test/defs/test_defs_lt.rb
CHANGED
@@ -3,7 +3,7 @@ require File.expand_path(File.dirname(__FILE__)) + '/../test_helper'
|
|
3
3
|
|
4
4
|
# This file is generated by the Ruby Holiday gem.
|
5
5
|
#
|
6
|
-
# Definitions loaded:
|
6
|
+
# Definitions loaded: definitions/lt.yaml
|
7
7
|
class LtDefinitionTests < Test::Unit::TestCase # :nodoc:
|
8
8
|
|
9
9
|
def test_lt
|
data/test/defs/test_defs_ma.rb
CHANGED
@@ -3,7 +3,7 @@ require File.expand_path(File.dirname(__FILE__)) + '/../test_helper'
|
|
3
3
|
|
4
4
|
# This file is generated by the Ruby Holiday gem.
|
5
5
|
#
|
6
|
-
# Definitions loaded:
|
6
|
+
# Definitions loaded: definitions/ma.yaml
|
7
7
|
class MaDefinitionTests < Test::Unit::TestCase # :nodoc:
|
8
8
|
|
9
9
|
def test_ma
|
data/test/defs/test_defs_mx.rb
CHANGED
@@ -3,7 +3,7 @@ require File.expand_path(File.dirname(__FILE__)) + '/../test_helper'
|
|
3
3
|
|
4
4
|
# This file is generated by the Ruby Holiday gem.
|
5
5
|
#
|
6
|
-
# Definitions loaded:
|
6
|
+
# Definitions loaded: definitions/mx.yaml, definitions/north_america_informal.yaml
|
7
7
|
class MxDefinitionTests < Test::Unit::TestCase # :nodoc:
|
8
8
|
|
9
9
|
def test_mx
|
data/test/defs/test_defs_nerc.rb
CHANGED
@@ -3,7 +3,7 @@ require File.expand_path(File.dirname(__FILE__)) + '/../test_helper'
|
|
3
3
|
|
4
4
|
# This file is generated by the Ruby Holiday gem.
|
5
5
|
#
|
6
|
-
# Definitions loaded:
|
6
|
+
# Definitions loaded: definitions/nerc.yaml
|
7
7
|
class NercDefinitionTests < Test::Unit::TestCase # :nodoc:
|
8
8
|
|
9
9
|
def test_nerc
|
data/test/defs/test_defs_nl.rb
CHANGED
@@ -3,7 +3,7 @@ require File.expand_path(File.dirname(__FILE__)) + '/../test_helper'
|
|
3
3
|
|
4
4
|
# This file is generated by the Ruby Holiday gem.
|
5
5
|
#
|
6
|
-
# Definitions loaded:
|
6
|
+
# Definitions loaded: definitions/nl.yaml
|
7
7
|
class NlDefinitionTests < Test::Unit::TestCase # :nodoc:
|
8
8
|
|
9
9
|
def test_nl
|
data/test/defs/test_defs_no.rb
CHANGED
@@ -3,7 +3,7 @@ require File.expand_path(File.dirname(__FILE__)) + '/../test_helper'
|
|
3
3
|
|
4
4
|
# This file is generated by the Ruby Holiday gem.
|
5
5
|
#
|
6
|
-
# Definitions loaded:
|
6
|
+
# Definitions loaded: definitions/no.yaml
|
7
7
|
class NoDefinitionTests < Test::Unit::TestCase # :nodoc:
|
8
8
|
|
9
9
|
def test_no
|
@@ -3,7 +3,7 @@ require File.expand_path(File.dirname(__FILE__)) + '/../test_helper'
|
|
3
3
|
|
4
4
|
# This file is generated by the Ruby Holiday gem.
|
5
5
|
#
|
6
|
-
# Definitions loaded:
|
6
|
+
# Definitions loaded: definitions/ca.yaml, definitions/mx.yaml, definitions/us.yaml, definitions/north_america_informal.yaml
|
7
7
|
class North_americaDefinitionTests < Test::Unit::TestCase # :nodoc:
|
8
8
|
|
9
9
|
def test_north_america
|
@@ -70,7 +70,7 @@ end
|
|
70
70
|
assert_equal name, (Holidays.on(date, :mx, :informal)[0] || {})[:name]
|
71
71
|
end
|
72
72
|
|
73
|
-
{Date.civil(2008,1,1) => 'New Year\'s Day',
|
73
|
+
{Date.civil(2008,1,1) => 'New Year\'s Day',
|
74
74
|
Date.civil(2008,1,21) => 'Martin Luther King, Jr. Day',
|
75
75
|
Date.civil(2008,2,18) => 'Presidents\' Day',
|
76
76
|
Date.civil(2008,5,26) => 'Memorial Day',
|
@@ -79,11 +79,13 @@ end
|
|
79
79
|
Date.civil(2008,10,13) => 'Columbus Day',
|
80
80
|
Date.civil(2008,11,11) => 'Veterans Day',
|
81
81
|
Date.civil(2008,11,27) => 'Thanksgiving',
|
82
|
+
Date.civil(2013,11,28) => 'Thanksgiving',
|
82
83
|
Date.civil(2008,12,25) => 'Christmas Day'}.each do |date, name|
|
83
84
|
assert_equal name, (Holidays.on(date, :us)[0] || {})[:name]
|
84
85
|
end
|
85
86
|
{Date.civil(2008, 3, 31) => 'Cesar Chavez Day',
|
86
|
-
Date.civil(2008, 11, 28) => 'Day after Thanksgiving'
|
87
|
+
Date.civil(2008, 11, 28) => 'Day after Thanksgiving',
|
88
|
+
Date.civil(2013, 11, 29) => 'Day after Thanksgiving'}.each do |date, name|
|
87
89
|
assert_equal name, (Holidays.on(date, :us, :us_ca)[0] || {})[:name]
|
88
90
|
end
|
89
91
|
|
data/test/defs/test_defs_nyse.rb
CHANGED
@@ -3,7 +3,7 @@ require File.expand_path(File.dirname(__FILE__)) + '/../test_helper'
|
|
3
3
|
|
4
4
|
# This file is generated by the Ruby Holiday gem.
|
5
5
|
#
|
6
|
-
# Definitions loaded:
|
6
|
+
# Definitions loaded: definitions/nyse.yaml
|
7
7
|
class NyseDefinitionTests < Test::Unit::TestCase # :nodoc:
|
8
8
|
|
9
9
|
def test_nyse
|
data/test/defs/test_defs_nz.rb
CHANGED
@@ -3,7 +3,7 @@ require File.expand_path(File.dirname(__FILE__)) + '/../test_helper'
|
|
3
3
|
|
4
4
|
# This file is generated by the Ruby Holiday gem.
|
5
5
|
#
|
6
|
-
# Definitions loaded:
|
6
|
+
# Definitions loaded: definitions/nz.yaml
|
7
7
|
class NzDefinitionTests < Test::Unit::TestCase # :nodoc:
|
8
8
|
|
9
9
|
def test_nz
|
@@ -17,14 +17,24 @@ class NzDefinitionTests < Test::Unit::TestCase # :nodoc:
|
|
17
17
|
Date.civil(2007,12,26) => 'Boxing Day'}.each do |date, name|
|
18
18
|
assert_equal name, (Holidays.on(date, :nz, :informal)[0] || {})[:name]
|
19
19
|
end
|
20
|
-
assert_equal 'ANZAC Day', Date.civil(2015, 4, 25)
|
21
|
-
assert_equal 'ANZAC Day', Date.civil(2015, 4, 27)
|
22
|
-
assert_equal 'ANZAC Day', Date.civil(2016, 4, 25)
|
23
|
-
assert_equal 'ANZAC Day', Date.civil(2016, 4, 25)
|
24
|
-
assert_equal 'Waitangi Day', Date.civil(2015, 2, 6)
|
25
|
-
assert_equal 'Waitangi Day', Date.civil(2015, 2, 6)
|
26
|
-
assert_equal 'Waitangi Day', Date.civil(2016, 2, 6)
|
27
|
-
assert_equal 'Waitangi Day', Date.civil(2016, 2, 8)
|
20
|
+
assert_equal 'ANZAC Day', Holidays.on(Date.civil(2015, 4, 25), :nz)[0][:name]
|
21
|
+
assert_equal 'ANZAC Day', Holidays.on(Date.civil(2015, 4, 27), :nz, :observed)[0][:name]
|
22
|
+
assert_equal 'ANZAC Day', Holidays.on(Date.civil(2016, 4, 25), :nz)[0][:name]
|
23
|
+
assert_equal 'ANZAC Day', Holidays.on(Date.civil(2016, 4, 25), :nz, :observed)[0][:name]
|
24
|
+
assert_equal 'Waitangi Day', Holidays.on(Date.civil(2015, 2, 6), :nz)[0][:name]
|
25
|
+
assert_equal 'Waitangi Day', Holidays.on(Date.civil(2015, 2, 6), :nz, :observed)[0][:name]
|
26
|
+
assert_equal 'Waitangi Day', Holidays.on(Date.civil(2016, 2, 6), :nz)[0][:name]
|
27
|
+
assert_equal 'Waitangi Day', Holidays.on(Date.civil(2016, 2, 8), :nz, :observed)[0][:name]
|
28
|
+
|
29
|
+
assert_equal 'Nelson Anniversary Day', Holidays.on(Date.civil(2016, 2, 1), :nz_ne, :observed)[0][:name]
|
30
|
+
assert_equal 'Nelson Anniversary Day', Holidays.on(Date.civil(2017, 1, 30), :nz_ne, :observed)[0][:name]
|
31
|
+
assert_equal 'Nelson Anniversary Day', Holidays.on(Date.civil(2018, 1, 29), :nz_ne, :observed)[0][:name]
|
32
|
+
assert_equal 'Nelson Anniversary Day', Holidays.on(Date.civil(2019, 2, 4), :nz_ne, :observed)[0][:name]
|
33
|
+
|
34
|
+
assert_equal 'Taranaki Anniversary Day', Holidays.on(Date.civil(2016, 3, 14), :nz_ta, :observed)[0][:name]
|
35
|
+
assert_equal 'Taranaki Anniversary Day', Holidays.on(Date.civil(2017, 3, 13), :nz_ta, :observed)[0][:name]
|
36
|
+
assert_equal 'Taranaki Anniversary Day', Holidays.on(Date.civil(2018, 3, 12), :nz_ta, :observed)[0][:name]
|
37
|
+
assert_equal 'Taranaki Anniversary Day', Holidays.on(Date.civil(2019, 3, 11), :nz_ta, :observed)[0][:name]
|
28
38
|
|
29
39
|
end
|
30
40
|
end
|
data/test/defs/test_defs_ph.rb
CHANGED
@@ -3,7 +3,7 @@ require File.expand_path(File.dirname(__FILE__)) + '/../test_helper'
|
|
3
3
|
|
4
4
|
# This file is generated by the Ruby Holiday gem.
|
5
5
|
#
|
6
|
-
# Definitions loaded:
|
6
|
+
# Definitions loaded: definitions/ph.yaml
|
7
7
|
class PhDefinitionTests < Test::Unit::TestCase # :nodoc:
|
8
8
|
|
9
9
|
def test_ph
|
data/test/defs/test_defs_pl.rb
CHANGED
@@ -3,7 +3,7 @@ require File.expand_path(File.dirname(__FILE__)) + '/../test_helper'
|
|
3
3
|
|
4
4
|
# This file is generated by the Ruby Holiday gem.
|
5
5
|
#
|
6
|
-
# Definitions loaded:
|
6
|
+
# Definitions loaded: definitions/pl.yaml
|
7
7
|
class PlDefinitionTests < Test::Unit::TestCase # :nodoc:
|
8
8
|
|
9
9
|
def test_pl
|
data/test/defs/test_defs_pt.rb
CHANGED
@@ -3,7 +3,7 @@ require File.expand_path(File.dirname(__FILE__)) + '/../test_helper'
|
|
3
3
|
|
4
4
|
# This file is generated by the Ruby Holiday gem.
|
5
5
|
#
|
6
|
-
# Definitions loaded:
|
6
|
+
# Definitions loaded: definitions/pt.yaml
|
7
7
|
class PtDefinitionTests < Test::Unit::TestCase # :nodoc:
|
8
8
|
|
9
9
|
def test_pt
|
data/test/defs/test_defs_ro.rb
CHANGED
@@ -3,7 +3,7 @@ require File.expand_path(File.dirname(__FILE__)) + '/../test_helper'
|
|
3
3
|
|
4
4
|
# This file is generated by the Ruby Holiday gem.
|
5
5
|
#
|
6
|
-
# Definitions loaded:
|
6
|
+
# Definitions loaded: definitions/ro.yaml
|
7
7
|
class RoDefinitionTests < Test::Unit::TestCase # :nodoc:
|
8
8
|
|
9
9
|
def test_ro
|
@@ -30,8 +30,7 @@ class RoDefinitionTests < Test::Unit::TestCase # :nodoc:
|
|
30
30
|
assert_equal name, (Holidays.on(date, :ro, :informal)[0] || {})[:name]
|
31
31
|
end
|
32
32
|
|
33
|
-
|
34
|
-
assert !Date.civil(2013,7,23).holiday?(:ro), '2010-07-23 is not a holiday in Romania'
|
33
|
+
assert_equal [], Holidays.on(Date.civil(2013,7,23), :ro), '2013-07-23 is not a holiday in Romania'
|
35
34
|
|
36
35
|
end
|
37
36
|
end
|
@@ -3,7 +3,7 @@ require File.expand_path(File.dirname(__FILE__)) + '/../test_helper'
|
|
3
3
|
|
4
4
|
# This file is generated by the Ruby Holiday gem.
|
5
5
|
#
|
6
|
-
# Definitions loaded:
|
6
|
+
# Definitions loaded: definitions/dk.yaml, definitions/is.yaml, definitions/no.yaml, definitions/se.yaml, definitions/fi.yaml
|
7
7
|
class ScandinaviaDefinitionTests < Test::Unit::TestCase # :nodoc:
|
8
8
|
|
9
9
|
def test_scandinavia
|
data/test/defs/test_defs_se.rb
CHANGED
@@ -3,7 +3,7 @@ require File.expand_path(File.dirname(__FILE__)) + '/../test_helper'
|
|
3
3
|
|
4
4
|
# This file is generated by the Ruby Holiday gem.
|
5
5
|
#
|
6
|
-
# Definitions loaded:
|
6
|
+
# Definitions loaded: definitions/se.yaml
|
7
7
|
class SeDefinitionTests < Test::Unit::TestCase # :nodoc:
|
8
8
|
|
9
9
|
def test_se
|
data/test/defs/test_defs_sg.rb
CHANGED
@@ -3,7 +3,7 @@ require File.expand_path(File.dirname(__FILE__)) + '/../test_helper'
|
|
3
3
|
|
4
4
|
# This file is generated by the Ruby Holiday gem.
|
5
5
|
#
|
6
|
-
# Definitions loaded:
|
6
|
+
# Definitions loaded: definitions/sg.yaml
|
7
7
|
class SgDefinitionTests < Test::Unit::TestCase # :nodoc:
|
8
8
|
|
9
9
|
def test_sg
|
data/test/defs/test_defs_si.rb
CHANGED
@@ -3,18 +3,18 @@ require File.expand_path(File.dirname(__FILE__)) + '/../test_helper'
|
|
3
3
|
|
4
4
|
# This file is generated by the Ruby Holiday gem.
|
5
5
|
#
|
6
|
-
# Definitions loaded:
|
6
|
+
# Definitions loaded: definitions/si.yaml
|
7
7
|
class SiDefinitionTests < Test::Unit::TestCase # :nodoc:
|
8
8
|
|
9
9
|
def test_si
|
10
|
-
assert_equal 'velikonočna nedelja', Date.civil(2015,4,5)
|
11
|
-
assert_equal 'velikonočna nedelja', Date.civil(2016,3,27)
|
10
|
+
assert_equal 'velikonočna nedelja', Holidays.on(Date.civil(2015,4,5), :si)[0][:name]
|
11
|
+
assert_equal 'velikonočna nedelja', Holidays.on(Date.civil(2016,3,27), :si)[0][:name]
|
12
12
|
|
13
|
-
assert_equal 'velikonočni ponedeljek', Date.civil(2015,4,6)
|
14
|
-
assert_equal 'velikonočni ponedeljek', Date.civil(2016,3,28)
|
13
|
+
assert_equal 'velikonočni ponedeljek', Holidays.on(Date.civil(2015,4,6), :si)[0][:name]
|
14
|
+
assert_equal 'velikonočni ponedeljek', Holidays.on(Date.civil(2016,3,28), :si)[0][:name]
|
15
15
|
|
16
|
-
assert_equal 'binkošti', Date.civil(2015,5,24)
|
17
|
-
assert_equal 'binkošti', Date.civil(2016,5,15)
|
16
|
+
assert_equal 'binkošti', Holidays.on(Date.civil(2015,5,24), :si)[0][:name]
|
17
|
+
assert_equal 'binkošti', Holidays.on(Date.civil(2016,5,15), :si)[0][:name]
|
18
18
|
|
19
19
|
(2014..2020).each do |year|
|
20
20
|
{Date.civil(year,1,1) => 'novo leto',
|
data/test/defs/test_defs_sk.rb
CHANGED
@@ -3,7 +3,7 @@ require File.expand_path(File.dirname(__FILE__)) + '/../test_helper'
|
|
3
3
|
|
4
4
|
# This file is generated by the Ruby Holiday gem.
|
5
5
|
#
|
6
|
-
# Definitions loaded:
|
6
|
+
# Definitions loaded: definitions/sk.yaml
|
7
7
|
class SkDefinitionTests < Test::Unit::TestCase # :nodoc:
|
8
8
|
|
9
9
|
def test_sk
|
@@ -3,7 +3,7 @@ require File.expand_path(File.dirname(__FILE__)) + '/../test_helper'
|
|
3
3
|
|
4
4
|
# This file is generated by the Ruby Holiday gem.
|
5
5
|
#
|
6
|
-
# Definitions loaded:
|
6
|
+
# Definitions loaded: definitions/united_nations.yaml
|
7
7
|
class United_nationsDefinitionTests < Test::Unit::TestCase # :nodoc:
|
8
8
|
|
9
9
|
def test_united_nations
|
data/test/defs/test_defs_ups.rb
CHANGED
@@ -3,19 +3,22 @@ require File.expand_path(File.dirname(__FILE__)) + '/../test_helper'
|
|
3
3
|
|
4
4
|
# This file is generated by the Ruby Holiday gem.
|
5
5
|
#
|
6
|
-
# Definitions loaded:
|
6
|
+
# Definitions loaded: definitions/ups.yaml
|
7
7
|
class UpsDefinitionTests < Test::Unit::TestCase # :nodoc:
|
8
8
|
|
9
9
|
def test_ups
|
10
|
-
{Date.civil(2008,1,1) => 'New Year\'s Day',
|
10
|
+
{Date.civil(2008,1,1) => 'New Year\'s Day',
|
11
11
|
Date.civil(2008,5,26) => 'Memorial Day',
|
12
12
|
Date.civil(2008,7,4) => 'Independence Day',
|
13
13
|
Date.civil(2008,9,1) => 'Labor Day',
|
14
14
|
Date.civil(2008,11,27) => 'Thanksgiving',
|
15
15
|
Date.civil(2008,11,28) => 'Day After Thanksgiving',
|
16
|
+
Date.civil(2013,11,28) => 'Thanksgiving',
|
17
|
+
Date.civil(2013,11,29) => 'Day After Thanksgiving',
|
16
18
|
Date.civil(2008,12,25) => 'Christmas Day',
|
17
19
|
Date.civil(2008,12,31) => 'New Year\'s Eve',}.each do |date, name|
|
18
20
|
assert_equal name, (Holidays.on(date, :ups)[0] || {})[:name]
|
19
21
|
end
|
22
|
+
|
20
23
|
end
|
21
24
|
end
|
data/test/defs/test_defs_us.rb
CHANGED
@@ -3,11 +3,11 @@ require File.expand_path(File.dirname(__FILE__)) + '/../test_helper'
|
|
3
3
|
|
4
4
|
# This file is generated by the Ruby Holiday gem.
|
5
5
|
#
|
6
|
-
# Definitions loaded:
|
6
|
+
# Definitions loaded: definitions/us.yaml, definitions/north_america_informal.yaml
|
7
7
|
class UsDefinitionTests < Test::Unit::TestCase # :nodoc:
|
8
8
|
|
9
9
|
def test_us
|
10
|
-
{Date.civil(2008,1,1) => 'New Year\'s Day',
|
10
|
+
{Date.civil(2008,1,1) => 'New Year\'s Day',
|
11
11
|
Date.civil(2008,1,21) => 'Martin Luther King, Jr. Day',
|
12
12
|
Date.civil(2008,2,18) => 'Presidents\' Day',
|
13
13
|
Date.civil(2008,5,26) => 'Memorial Day',
|
@@ -16,11 +16,13 @@ class UsDefinitionTests < Test::Unit::TestCase # :nodoc:
|
|
16
16
|
Date.civil(2008,10,13) => 'Columbus Day',
|
17
17
|
Date.civil(2008,11,11) => 'Veterans Day',
|
18
18
|
Date.civil(2008,11,27) => 'Thanksgiving',
|
19
|
+
Date.civil(2013,11,28) => 'Thanksgiving',
|
19
20
|
Date.civil(2008,12,25) => 'Christmas Day'}.each do |date, name|
|
20
21
|
assert_equal name, (Holidays.on(date, :us)[0] || {})[:name]
|
21
22
|
end
|
22
23
|
{Date.civil(2008, 3, 31) => 'Cesar Chavez Day',
|
23
|
-
Date.civil(2008, 11, 28) => 'Day after Thanksgiving'
|
24
|
+
Date.civil(2008, 11, 28) => 'Day after Thanksgiving',
|
25
|
+
Date.civil(2013, 11, 29) => 'Day after Thanksgiving'}.each do |date, name|
|
24
26
|
assert_equal name, (Holidays.on(date, :us, :us_ca)[0] || {})[:name]
|
25
27
|
end
|
26
28
|
|
data/test/defs/test_defs_ve.rb
CHANGED
@@ -3,7 +3,7 @@ require File.expand_path(File.dirname(__FILE__)) + '/../test_helper'
|
|
3
3
|
|
4
4
|
# This file is generated by the Ruby Holiday gem.
|
5
5
|
#
|
6
|
-
# Definitions loaded:
|
6
|
+
# Definitions loaded: definitions/ve.yaml
|
7
7
|
class VeDefinitionTests < Test::Unit::TestCase # :nodoc:
|
8
8
|
|
9
9
|
def test_ve
|
data/test/defs/test_defs_vi.rb
CHANGED
@@ -3,7 +3,7 @@ require File.expand_path(File.dirname(__FILE__)) + '/../test_helper'
|
|
3
3
|
|
4
4
|
# This file is generated by the Ruby Holiday gem.
|
5
5
|
#
|
6
|
-
# Definitions loaded:
|
6
|
+
# Definitions loaded: definitions/vi.yaml
|
7
7
|
class ViDefinitionTests < Test::Unit::TestCase # :nodoc:
|
8
8
|
|
9
9
|
def test_vi
|