holidays 6.6.1 → 7.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (100) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +16 -0
  3. data/lib/generated_definitions/MANIFEST +7 -5
  4. data/lib/generated_definitions/REGIONS.rb +2 -2
  5. data/lib/generated_definitions/ar.rb +2 -2
  6. data/lib/generated_definitions/at.rb +2 -2
  7. data/lib/generated_definitions/au.rb +2 -2
  8. data/lib/generated_definitions/be_fr.rb +2 -2
  9. data/lib/generated_definitions/be_nl.rb +2 -2
  10. data/lib/generated_definitions/bg.rb +2 -2
  11. data/lib/generated_definitions/br.rb +2 -2
  12. data/lib/generated_definitions/ca.rb +5 -4
  13. data/lib/generated_definitions/ch.rb +2 -2
  14. data/lib/generated_definitions/cl.rb +2 -2
  15. data/lib/generated_definitions/co.rb +2 -2
  16. data/lib/generated_definitions/cr.rb +2 -2
  17. data/lib/generated_definitions/cz.rb +2 -2
  18. data/lib/generated_definitions/de.rb +2 -2
  19. data/lib/generated_definitions/dk.rb +2 -2
  20. data/lib/generated_definitions/{ecb_target.rb → ecbtarget.rb} +10 -10
  21. data/lib/generated_definitions/ee.rb +2 -2
  22. data/lib/generated_definitions/el.rb +2 -2
  23. data/lib/generated_definitions/es.rb +2 -2
  24. data/lib/generated_definitions/europe.rb +26 -13
  25. data/lib/generated_definitions/{federal_reserve.rb → federalreserve.rb} +14 -14
  26. data/lib/generated_definitions/federalreservebanks.rb +34 -0
  27. data/lib/generated_definitions/fedex.rb +2 -2
  28. data/lib/generated_definitions/fi.rb +2 -2
  29. data/lib/generated_definitions/fr.rb +2 -2
  30. data/lib/generated_definitions/gb.rb +2 -2
  31. data/lib/generated_definitions/ge.rb +2 -2
  32. data/lib/generated_definitions/hk.rb +2 -2
  33. data/lib/generated_definitions/hr.rb +2 -2
  34. data/lib/generated_definitions/hu.rb +2 -2
  35. data/lib/generated_definitions/ie.rb +2 -2
  36. data/lib/generated_definitions/is.rb +2 -2
  37. data/lib/generated_definitions/it.rb +2 -2
  38. data/lib/generated_definitions/jp.rb +12 -6
  39. data/lib/generated_definitions/kr.rb +2 -2
  40. data/lib/generated_definitions/li.rb +2 -2
  41. data/lib/generated_definitions/lt.rb +2 -2
  42. data/lib/generated_definitions/lu.rb +2 -2
  43. data/lib/generated_definitions/ma.rb +2 -2
  44. data/lib/generated_definitions/mt_en.rb +2 -2
  45. data/lib/generated_definitions/mt_mt.rb +2 -2
  46. data/lib/generated_definitions/mx.rb +3 -3
  47. data/lib/generated_definitions/my.rb +2 -2
  48. data/lib/generated_definitions/nerc.rb +2 -2
  49. data/lib/generated_definitions/nl.rb +2 -2
  50. data/lib/generated_definitions/no.rb +2 -2
  51. data/lib/generated_definitions/{north_america.rb → northamerica.rb} +6 -5
  52. data/lib/generated_definitions/nyse.rb +2 -2
  53. data/lib/generated_definitions/nz.rb +2 -2
  54. data/lib/generated_definitions/pe.rb +2 -2
  55. data/lib/generated_definitions/ph.rb +2 -2
  56. data/lib/generated_definitions/pl.rb +2 -2
  57. data/lib/generated_definitions/pt.rb +2 -2
  58. data/lib/generated_definitions/ro.rb +2 -2
  59. data/lib/generated_definitions/rs_cyrl.rb +2 -2
  60. data/lib/generated_definitions/rs_la.rb +2 -2
  61. data/lib/generated_definitions/ru.rb +2 -2
  62. data/lib/generated_definitions/scandinavia.rb +2 -2
  63. data/lib/generated_definitions/se.rb +2 -2
  64. data/lib/generated_definitions/sg.rb +2 -2
  65. data/lib/generated_definitions/si.rb +2 -2
  66. data/lib/generated_definitions/sk.rb +2 -2
  67. data/lib/generated_definitions/{south_america.rb → southamerica.rb} +3 -3
  68. data/lib/generated_definitions/tn.rb +2 -2
  69. data/lib/generated_definitions/tr.rb +2 -2
  70. data/lib/generated_definitions/ua.rb +37 -0
  71. data/lib/generated_definitions/{united_nations.rb → unitednations.rb} +61 -61
  72. data/lib/generated_definitions/ups.rb +2 -2
  73. data/lib/generated_definitions/us.rb +3 -3
  74. data/lib/generated_definitions/ve.rb +2 -2
  75. data/lib/generated_definitions/vi.rb +2 -2
  76. data/lib/generated_definitions/za.rb +2 -2
  77. data/lib/holidays/definition/context/generator.rb +3 -36
  78. data/lib/holidays/definition/generator/module.rb +54 -0
  79. data/lib/holidays/definition/generator/regions.rb +1 -1
  80. data/lib/holidays/factory/definition.rb +7 -0
  81. data/lib/holidays/version.rb +1 -1
  82. data/test/defs/test_defs_ca.rb +18 -2
  83. data/test/defs/{test_defs_ecb_target.rb → test_defs_ecbtarget.rb} +11 -11
  84. data/test/defs/test_defs_europe.rb +31 -1
  85. data/test/defs/{test_defs_federal_reserve.rb → test_defs_federalreserve.rb} +54 -54
  86. data/test/defs/test_defs_federalreservebanks.rb +113 -0
  87. data/test/defs/test_defs_jp.rb +19 -1
  88. data/test/defs/test_defs_mx.rb +1 -1
  89. data/test/defs/{test_defs_north_america.rb → test_defs_northamerica.rb} +20 -4
  90. data/test/defs/{test_defs_south_america.rb → test_defs_southamerica.rb} +2 -2
  91. data/test/defs/test_defs_ua.rb +41 -0
  92. data/test/defs/{test_defs_united_nations.rb → test_defs_unitednations.rb} +3 -3
  93. data/test/defs/test_defs_us.rb +1 -1
  94. data/test/holidays/definition/context/test_generator.rb +13 -3
  95. data/test/holidays/definition/generator/test_module.rb +268 -0
  96. data/test/integration/test_available_regions.rb +1 -1
  97. data/test/integration/test_holidays.rb +1 -7
  98. data/test/integration/test_holidays_between.rb +1 -1
  99. data/test/integration/test_nonstandard_regions.rb +25 -0
  100. metadata +28 -17
@@ -0,0 +1,54 @@
1
+ require 'holidays/errors'
2
+
3
+ module Holidays
4
+ module Definition
5
+ module Generator
6
+ class Module
7
+ def call(module_name, files, regions, month_strings, custom_methods)
8
+ raise ArgumentError.new("module name cannot be nil") if module_name.nil?
9
+ raise ArgumentError.new("module name cannot be blank") if module_name.empty?
10
+
11
+ raise ArgumentError.new("files cannot be nil") if files.nil?
12
+ raise ArgumentError.new("files cannot be empty") if files.empty?
13
+ raise ArgumentError.new("files must all be strings") unless files.all? { |f| f.is_a?(String) }
14
+
15
+ raise ArgumentError.new("regions cannot be nil") if regions.nil?
16
+ raise ArgumentError.new("regions cannot be empty") if regions.empty?
17
+
18
+ raise ArgumentError.new("month strings cannot be nil") if month_strings.nil?
19
+ raise ArgumentError.new("month strings cannot be empty") if month_strings.empty?
20
+
21
+ module_src =<<-EOM
22
+ # encoding: utf-8
23
+ module Holidays
24
+ # This file is generated by the Ruby Holidays gem.
25
+ #
26
+ # Definitions loaded: #{files.join(', ')}
27
+ #
28
+ # All the definitions are available at https://github.com/holidays/holidays
29
+ module #{module_name.to_s.upcase} # :nodoc:
30
+ def self.defined_regions
31
+ [:#{regions.join(', :')}]
32
+ end
33
+
34
+ def self.holidays_by_month
35
+ {
36
+ #{month_strings.join(",\n")}
37
+ }
38
+ end
39
+
40
+ def self.custom_methods
41
+ {
42
+ #{custom_methods}
43
+ }
44
+ end
45
+ end
46
+ end
47
+ EOM
48
+
49
+ module_src
50
+ end
51
+ end
52
+ end
53
+ end
54
+ end
@@ -2,7 +2,7 @@ module Holidays
2
2
  module Definition
3
3
  module Generator
4
4
  class Regions
5
- # The "ca", "mx", and "us" holiday definitions include the "north_america_informal"
5
+ # The "ca", "mx", and "us" holiday definitions include the "northamericainformal"
6
6
  # holiday definitions, but that does not make these countries subregions of one another.
7
7
  NORTH_AMERICA_REGIONS = %i[ca mx us].freeze
8
8
 
@@ -5,6 +5,7 @@ require 'holidays/definition/context/load'
5
5
  require 'holidays/definition/decorator/custom_method_proc'
6
6
  require 'holidays/definition/decorator/custom_method_source'
7
7
  require 'holidays/definition/decorator/test'
8
+ require 'holidays/definition/generator/module'
8
9
  require 'holidays/definition/generator/regions'
9
10
  require 'holidays/definition/generator/test'
10
11
  require 'holidays/definition/parser/custom_method'
@@ -29,6 +30,7 @@ module Holidays
29
30
  custom_methods_repository,
30
31
  test_parser,
31
32
  test_generator,
33
+ module_generator,
32
34
  )
33
35
  end
34
36
 
@@ -39,6 +41,7 @@ module Holidays
39
41
  custom_methods_repository,
40
42
  test_parser,
41
43
  test_generator,
44
+ module_generator,
42
45
  )
43
46
  end
44
47
 
@@ -115,6 +118,10 @@ module Holidays
115
118
  )
116
119
  end
117
120
 
121
+ def module_generator
122
+ Holidays::Definition::Generator::Module.new
123
+ end
124
+
118
125
  def test_generator
119
126
  Holidays::Definition::Generator::Test.new(
120
127
  test_decorator,
@@ -1,3 +1,3 @@
1
1
  module Holidays
2
- VERSION = '6.6.1'
2
+ VERSION = '7.0.0'
3
3
  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: definitions/ca.yaml, definitions/north_america_informal.yaml
6
+ # Definitions loaded: definitions/ca.yaml, definitions/northamericainformal.yaml
7
7
  class CaDefinitionTests < Test::Unit::TestCase # :nodoc:
8
8
 
9
9
  def test_ca
@@ -73,7 +73,7 @@ class CaDefinitionTests < Test::Unit::TestCase # :nodoc:
73
73
 
74
74
  assert_equal "Family Day", (Holidays.on(Date.civil(2014, 2, 10), [:ca_bc])[0] || {})[:name]
75
75
 
76
- assert_equal "Family Day", (Holidays.on(Date.civil(2044, 2, 8), [:ca_bc])[0] || {})[:name]
76
+ assert_equal "Family Day", (Holidays.on(Date.civil(2018, 2, 12), [:ca_bc])[0] || {})[:name]
77
77
 
78
78
  assert_nil (Holidays.on(Date.civil(2000, 2, 14), [:ca_bc])[0] || {})[:name]
79
79
 
@@ -81,6 +81,22 @@ class CaDefinitionTests < Test::Unit::TestCase # :nodoc:
81
81
 
82
82
  assert_nil (Holidays.on(Date.civil(2012, 2, 13), [:ca_bc])[0] || {})[:name]
83
83
 
84
+ assert_nil (Holidays.on(Date.civil(2019, 2, 11), [:ca_bc])[0] || {})[:name]
85
+
86
+ assert_nil (Holidays.on(Date.civil(2044, 2, 8), [:ca_bc])[0] || {})[:name]
87
+
88
+ assert_equal "Family Day", (Holidays.on(Date.civil(2019, 2, 18), [:ca_bc])[0] || {})[:name]
89
+
90
+ assert_equal "Family Day", (Holidays.on(Date.civil(2020, 2, 17), [:ca_bc])[0] || {})[:name]
91
+
92
+ assert_equal "Family Day", (Holidays.on(Date.civil(2044, 2, 15), [:ca_bc])[0] || {})[:name]
93
+
94
+ assert_nil (Holidays.on(Date.civil(2000, 2, 21), [:ca_bc])[0] || {})[:name]
95
+
96
+ assert_nil (Holidays.on(Date.civil(2011, 2, 21), [:ca_bc])[0] || {})[:name]
97
+
98
+ assert_nil (Holidays.on(Date.civil(2018, 2, 19), [:ca_bc])[0] || {})[:name]
99
+
84
100
  assert_equal "Family Day", (Holidays.on(Date.civil(2018, 2, 19), [:ca_nb])[0] || {})[:name]
85
101
 
86
102
  assert_equal "Family Day", (Holidays.on(Date.civil(2019, 2, 18), [:ca_nb])[0] || {})[:name]
@@ -3,25 +3,25 @@ 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: definitions/ecb_target.yaml
7
- class Ecb_targetDefinitionTests < Test::Unit::TestCase # :nodoc:
6
+ # Definitions loaded: definitions/ecbtarget.yaml
7
+ class EcbtargetDefinitionTests < Test::Unit::TestCase # :nodoc:
8
8
 
9
- def test_ecb_target
10
- assert_equal "New Year's Day", (Holidays.on(Date.civil(2013, 1, 1), [:ecb_target])[0] || {})[:name]
9
+ def test_ecbtarget
10
+ assert_equal "New Year's Day", (Holidays.on(Date.civil(2013, 1, 1), [:ecbtarget])[0] || {})[:name]
11
11
 
12
- assert_equal "Labour Day", (Holidays.on(Date.civil(2013, 5, 1), [:ecb_target])[0] || {})[:name]
12
+ assert_equal "Labour Day", (Holidays.on(Date.civil(2013, 5, 1), [:ecbtarget])[0] || {})[:name]
13
13
 
14
- assert_equal "Good Friday", (Holidays.on(Date.civil(2013, 3, 29), [:ecb_target])[0] || {})[:name]
14
+ assert_equal "Good Friday", (Holidays.on(Date.civil(2013, 3, 29), [:ecbtarget])[0] || {})[:name]
15
15
 
16
- assert_equal "Easter Monday", (Holidays.on(Date.civil(2013, 4, 1), [:ecb_target])[0] || {})[:name]
16
+ assert_equal "Easter Monday", (Holidays.on(Date.civil(2013, 4, 1), [:ecbtarget])[0] || {})[:name]
17
17
 
18
- assert_equal "Christmas Day", (Holidays.on(Date.civil(2013, 12, 25), [:ecb_target])[0] || {})[:name]
18
+ assert_equal "Christmas Day", (Holidays.on(Date.civil(2013, 12, 25), [:ecbtarget])[0] || {})[:name]
19
19
 
20
- assert_equal "Christmas Holiday", (Holidays.on(Date.civil(2013, 12, 26), [:ecb_target])[0] || {})[:name]
20
+ assert_equal "Christmas Holiday", (Holidays.on(Date.civil(2013, 12, 26), [:ecbtarget])[0] || {})[:name]
21
21
 
22
- assert_equal "Good Friday", (Holidays.on(Date.civil(2013, 3, 29), [:ecb_target])[0] || {})[:name]
22
+ assert_equal "Good Friday", (Holidays.on(Date.civil(2013, 3, 29), [:ecbtarget])[0] || {})[:name]
23
23
 
24
- assert_equal "Easter Monday", (Holidays.on(Date.civil(2013, 4, 1), [:ecb_target])[0] || {})[:name]
24
+ assert_equal "Easter Monday", (Holidays.on(Date.civil(2013, 4, 1), [:ecbtarget])[0] || {})[:name]
25
25
 
26
26
  end
27
27
  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: definitions/at.yaml, definitions/be_fr.yaml, definitions/be_nl.yaml, definitions/ch.yaml, definitions/cz.yaml, definitions/dk.yaml, definitions/de.yaml, definitions/el.yaml, definitions/es.yaml, definitions/fr.yaml, definitions/gb.yaml, definitions/hr.yaml, definitions/hu.yaml, definitions/ie.yaml, definitions/is.yaml, definitions/it.yaml, definitions/li.yaml, definitions/lt.yaml, definitions/nl.yaml, definitions/no.yaml, definitions/pl.yaml, definitions/pt.yaml, definitions/ro.yaml, definitions/sk.yaml, definitions/si.yaml, definitions/bg.yaml
6
+ # Definitions loaded: definitions/at.yaml, definitions/be_fr.yaml, definitions/be_nl.yaml, definitions/ch.yaml, definitions/cz.yaml, definitions/dk.yaml, definitions/de.yaml, definitions/el.yaml, definitions/es.yaml, definitions/fr.yaml, definitions/gb.yaml, definitions/hr.yaml, definitions/hu.yaml, definitions/ie.yaml, definitions/is.yaml, definitions/it.yaml, definitions/li.yaml, definitions/lt.yaml, definitions/nl.yaml, definitions/no.yaml, definitions/pl.yaml, definitions/pt.yaml, definitions/ro.yaml, definitions/sk.yaml, definitions/si.yaml, definitions/bg.yaml, definitions/ua.yaml
7
7
  class EuropeDefinitionTests < Test::Unit::TestCase # :nodoc:
8
8
 
9
9
  def test_europe
@@ -1293,5 +1293,35 @@ assert_equal "božič", (Holidays.on(Date.civil(2020, 12, 25), [:si], [:informal
1293
1293
 
1294
1294
  assert_equal "Christmas", (Holidays.on(Date.civil(2015, 12, 26), [:bg_en])[0] || {})[:name]
1295
1295
 
1296
+ assert_equal "Новий Рік", (Holidays.on(Date.civil(2018, 1, 1), [:ua])[0] || {})[:name]
1297
+
1298
+ assert_equal "Різдво Христове", (Holidays.on(Date.civil(2018, 1, 7), [:ua])[0] || {})[:name]
1299
+
1300
+ assert_equal "Різдво Христове", (Holidays.on(Date.civil(2018, 1, 8), [:ua], [:observed])[0] || {})[:name]
1301
+
1302
+ assert_equal "Міжнародний жіночий день", (Holidays.on(Date.civil(2018, 3, 8), [:ua])[0] || {})[:name]
1303
+
1304
+ assert_equal "Великдень", (Holidays.on(Date.civil(2018, 4, 8), [:ua])[0] || {})[:name]
1305
+
1306
+ assert_equal "Великдень", (Holidays.on(Date.civil(2018, 4, 9), [:ua], [:observed])[0] || {})[:name]
1307
+
1308
+ assert_equal "День праці", (Holidays.on(Date.civil(2018, 5, 1), [:ua])[0] || {})[:name]
1309
+
1310
+ assert_equal "День перемоги над нацизмом у Другій світовій війні", (Holidays.on(Date.civil(2018, 5, 9), [:ua])[0] || {})[:name]
1311
+
1312
+ assert_equal "Трійця", (Holidays.on(Date.civil(2018, 5, 27), [:ua])[0] || {})[:name]
1313
+
1314
+ assert_equal "Трійця", (Holidays.on(Date.civil(2018, 5, 28), [:ua], [:observed])[0] || {})[:name]
1315
+
1316
+ assert_equal "День Конституції", (Holidays.on(Date.civil(2018, 6, 28), [:ua])[0] || {})[:name]
1317
+
1318
+ assert_equal "День Незалежності", (Holidays.on(Date.civil(2018, 8, 24), [:ua])[0] || {})[:name]
1319
+
1320
+ assert_equal "День захисника України", (Holidays.on(Date.civil(2018, 10, 14), [:ua])[0] || {})[:name]
1321
+
1322
+ assert_equal "День захисника України", (Holidays.on(Date.civil(2018, 10, 15), [:ua], [:observed])[0] || {})[:name]
1323
+
1324
+ assert_equal "Різдво Христове", (Holidays.on(Date.civil(2018, 12, 25), [:ua])[0] || {})[:name]
1325
+
1296
1326
  end
1297
1327
  end
@@ -3,111 +3,111 @@ 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: definitions/federal_reserve.yaml
7
- class Federal_reserveDefinitionTests < Test::Unit::TestCase # :nodoc:
6
+ # Definitions loaded: definitions/federalreserve.yaml
7
+ class FederalreserveDefinitionTests < Test::Unit::TestCase # :nodoc:
8
8
 
9
- def test_federal_reserve
10
- assert_equal "New Year's Day", (Holidays.on(Date.civil(2012, 1, 2), [:federal_reserve], [:observed])[0] || {})[:name]
9
+ def test_federalreserve
10
+ assert_equal "New Year's Day", (Holidays.on(Date.civil(2012, 1, 2), [:federalreserve], [:observed])[0] || {})[:name]
11
11
 
12
- assert_equal "Birthday of Martin Luther King, Jr", (Holidays.on(Date.civil(2012, 1, 16), [:federal_reserve], [:observed])[0] || {})[:name]
12
+ assert_equal "Birthday of Martin Luther King, Jr", (Holidays.on(Date.civil(2012, 1, 16), [:federalreserve], [:observed])[0] || {})[:name]
13
13
 
14
- assert_equal "Washington's Birthday", (Holidays.on(Date.civil(2012, 2, 20), [:federal_reserve], [:observed])[0] || {})[:name]
14
+ assert_equal "Washington's Birthday", (Holidays.on(Date.civil(2012, 2, 20), [:federalreserve], [:observed])[0] || {})[:name]
15
15
 
16
- assert_equal "Memorial Day", (Holidays.on(Date.civil(2012, 5, 28), [:federal_reserve], [:observed])[0] || {})[:name]
16
+ assert_equal "Memorial Day", (Holidays.on(Date.civil(2012, 5, 28), [:federalreserve], [:observed])[0] || {})[:name]
17
17
 
18
- assert_equal "Independence Day", (Holidays.on(Date.civil(2012, 7, 4), [:federal_reserve], [:observed])[0] || {})[:name]
18
+ assert_equal "Independence Day", (Holidays.on(Date.civil(2012, 7, 4), [:federalreserve], [:observed])[0] || {})[:name]
19
19
 
20
- assert_equal "Independence Day", (Holidays.on(Date.civil(2020, 7, 3), [:federal_reserve], [:observed])[0] || {})[:name]
20
+ assert_equal "Independence Day", (Holidays.on(Date.civil(2020, 7, 3), [:federalreserve], [:observed])[0] || {})[:name]
21
21
 
22
- assert_equal "Labor Day", (Holidays.on(Date.civil(2012, 9, 3), [:federal_reserve], [:observed])[0] || {})[:name]
22
+ assert_equal "Labor Day", (Holidays.on(Date.civil(2012, 9, 3), [:federalreserve], [:observed])[0] || {})[:name]
23
23
 
24
- assert_equal "Columbus Day", (Holidays.on(Date.civil(2012, 10, 8), [:federal_reserve], [:observed])[0] || {})[:name]
24
+ assert_equal "Columbus Day", (Holidays.on(Date.civil(2012, 10, 8), [:federalreserve], [:observed])[0] || {})[:name]
25
25
 
26
- assert_equal "Veterans Day", (Holidays.on(Date.civil(2012, 11, 12), [:federal_reserve], [:observed])[0] || {})[:name]
26
+ assert_equal "Veterans Day", (Holidays.on(Date.civil(2012, 11, 12), [:federalreserve], [:observed])[0] || {})[:name]
27
27
 
28
- assert_equal "Thanksgiving Day", (Holidays.on(Date.civil(2012, 11, 22), [:federal_reserve], [:observed])[0] || {})[:name]
28
+ assert_equal "Thanksgiving Day", (Holidays.on(Date.civil(2012, 11, 22), [:federalreserve], [:observed])[0] || {})[:name]
29
29
 
30
- assert_equal "Christmas Day", (Holidays.on(Date.civil(2012, 12, 25), [:federal_reserve], [:observed])[0] || {})[:name]
30
+ assert_equal "Christmas Day", (Holidays.on(Date.civil(2012, 12, 25), [:federalreserve], [:observed])[0] || {})[:name]
31
31
 
32
- assert_equal "New Year's Day", (Holidays.on(Date.civil(2013, 1, 1), [:federal_reserve], [:observed])[0] || {})[:name]
32
+ assert_equal "New Year's Day", (Holidays.on(Date.civil(2013, 1, 1), [:federalreserve], [:observed])[0] || {})[:name]
33
33
 
34
- assert_equal "Birthday of Martin Luther King, Jr", (Holidays.on(Date.civil(2013, 1, 21), [:federal_reserve], [:observed])[0] || {})[:name]
34
+ assert_equal "Birthday of Martin Luther King, Jr", (Holidays.on(Date.civil(2013, 1, 21), [:federalreserve], [:observed])[0] || {})[:name]
35
35
 
36
- assert_equal "Washington's Birthday", (Holidays.on(Date.civil(2013, 2, 18), [:federal_reserve], [:observed])[0] || {})[:name]
36
+ assert_equal "Washington's Birthday", (Holidays.on(Date.civil(2013, 2, 18), [:federalreserve], [:observed])[0] || {})[:name]
37
37
 
38
- assert_equal "Memorial Day", (Holidays.on(Date.civil(2013, 5, 27), [:federal_reserve], [:observed])[0] || {})[:name]
38
+ assert_equal "Memorial Day", (Holidays.on(Date.civil(2013, 5, 27), [:federalreserve], [:observed])[0] || {})[:name]
39
39
 
40
- assert_equal "Independence Day", (Holidays.on(Date.civil(2013, 7, 4), [:federal_reserve], [:observed])[0] || {})[:name]
40
+ assert_equal "Independence Day", (Holidays.on(Date.civil(2013, 7, 4), [:federalreserve], [:observed])[0] || {})[:name]
41
41
 
42
- assert_equal "Labor Day", (Holidays.on(Date.civil(2013, 9, 2), [:federal_reserve], [:observed])[0] || {})[:name]
42
+ assert_equal "Labor Day", (Holidays.on(Date.civil(2013, 9, 2), [:federalreserve], [:observed])[0] || {})[:name]
43
43
 
44
- assert_equal "Columbus Day", (Holidays.on(Date.civil(2013, 10, 14), [:federal_reserve], [:observed])[0] || {})[:name]
44
+ assert_equal "Columbus Day", (Holidays.on(Date.civil(2013, 10, 14), [:federalreserve], [:observed])[0] || {})[:name]
45
45
 
46
- assert_equal "Veterans Day", (Holidays.on(Date.civil(2013, 11, 11), [:federal_reserve], [:observed])[0] || {})[:name]
46
+ assert_equal "Veterans Day", (Holidays.on(Date.civil(2013, 11, 11), [:federalreserve], [:observed])[0] || {})[:name]
47
47
 
48
- assert_equal "Thanksgiving Day", (Holidays.on(Date.civil(2013, 11, 28), [:federal_reserve], [:observed])[0] || {})[:name]
48
+ assert_equal "Thanksgiving Day", (Holidays.on(Date.civil(2013, 11, 28), [:federalreserve], [:observed])[0] || {})[:name]
49
49
 
50
- assert_equal "Christmas Day", (Holidays.on(Date.civil(2013, 12, 25), [:federal_reserve], [:observed])[0] || {})[:name]
50
+ assert_equal "Christmas Day", (Holidays.on(Date.civil(2013, 12, 25), [:federalreserve], [:observed])[0] || {})[:name]
51
51
 
52
- assert_equal "New Year's Day", (Holidays.on(Date.civil(2014, 1, 1), [:federal_reserve], [:observed])[0] || {})[:name]
52
+ assert_equal "New Year's Day", (Holidays.on(Date.civil(2014, 1, 1), [:federalreserve], [:observed])[0] || {})[:name]
53
53
 
54
- assert_equal "Birthday of Martin Luther King, Jr", (Holidays.on(Date.civil(2014, 1, 20), [:federal_reserve], [:observed])[0] || {})[:name]
54
+ assert_equal "Birthday of Martin Luther King, Jr", (Holidays.on(Date.civil(2014, 1, 20), [:federalreserve], [:observed])[0] || {})[:name]
55
55
 
56
- assert_equal "Washington's Birthday", (Holidays.on(Date.civil(2014, 2, 17), [:federal_reserve], [:observed])[0] || {})[:name]
56
+ assert_equal "Washington's Birthday", (Holidays.on(Date.civil(2014, 2, 17), [:federalreserve], [:observed])[0] || {})[:name]
57
57
 
58
- assert_equal "Memorial Day", (Holidays.on(Date.civil(2014, 5, 26), [:federal_reserve], [:observed])[0] || {})[:name]
58
+ assert_equal "Memorial Day", (Holidays.on(Date.civil(2014, 5, 26), [:federalreserve], [:observed])[0] || {})[:name]
59
59
 
60
- assert_equal "Independence Day", (Holidays.on(Date.civil(2014, 7, 4), [:federal_reserve], [:observed])[0] || {})[:name]
60
+ assert_equal "Independence Day", (Holidays.on(Date.civil(2014, 7, 4), [:federalreserve], [:observed])[0] || {})[:name]
61
61
 
62
- assert_equal "Labor Day", (Holidays.on(Date.civil(2014, 9, 1), [:federal_reserve], [:observed])[0] || {})[:name]
62
+ assert_equal "Labor Day", (Holidays.on(Date.civil(2014, 9, 1), [:federalreserve], [:observed])[0] || {})[:name]
63
63
 
64
- assert_equal "Columbus Day", (Holidays.on(Date.civil(2014, 10, 13), [:federal_reserve], [:observed])[0] || {})[:name]
64
+ assert_equal "Columbus Day", (Holidays.on(Date.civil(2014, 10, 13), [:federalreserve], [:observed])[0] || {})[:name]
65
65
 
66
- assert_equal "Veterans Day", (Holidays.on(Date.civil(2014, 11, 11), [:federal_reserve], [:observed])[0] || {})[:name]
66
+ assert_equal "Veterans Day", (Holidays.on(Date.civil(2014, 11, 11), [:federalreserve], [:observed])[0] || {})[:name]
67
67
 
68
- assert_equal "Thanksgiving Day", (Holidays.on(Date.civil(2014, 11, 27), [:federal_reserve], [:observed])[0] || {})[:name]
68
+ assert_equal "Thanksgiving Day", (Holidays.on(Date.civil(2014, 11, 27), [:federalreserve], [:observed])[0] || {})[:name]
69
69
 
70
- assert_equal "Christmas Day", (Holidays.on(Date.civil(2014, 12, 25), [:federal_reserve], [:observed])[0] || {})[:name]
70
+ assert_equal "Christmas Day", (Holidays.on(Date.civil(2014, 12, 25), [:federalreserve], [:observed])[0] || {})[:name]
71
71
 
72
- assert_equal "New Year's Day", (Holidays.on(Date.civil(2015, 1, 1), [:federal_reserve], [:observed])[0] || {})[:name]
72
+ assert_equal "New Year's Day", (Holidays.on(Date.civil(2015, 1, 1), [:federalreserve], [:observed])[0] || {})[:name]
73
73
 
74
- assert_equal "Birthday of Martin Luther King, Jr", (Holidays.on(Date.civil(2015, 1, 19), [:federal_reserve], [:observed])[0] || {})[:name]
74
+ assert_equal "Birthday of Martin Luther King, Jr", (Holidays.on(Date.civil(2015, 1, 19), [:federalreserve], [:observed])[0] || {})[:name]
75
75
 
76
- assert_equal "Washington's Birthday", (Holidays.on(Date.civil(2015, 2, 16), [:federal_reserve], [:observed])[0] || {})[:name]
76
+ assert_equal "Washington's Birthday", (Holidays.on(Date.civil(2015, 2, 16), [:federalreserve], [:observed])[0] || {})[:name]
77
77
 
78
- assert_equal "Memorial Day", (Holidays.on(Date.civil(2015, 5, 25), [:federal_reserve], [:observed])[0] || {})[:name]
78
+ assert_equal "Memorial Day", (Holidays.on(Date.civil(2015, 5, 25), [:federalreserve], [:observed])[0] || {})[:name]
79
79
 
80
- assert_equal "Independence Day", (Holidays.on(Date.civil(2015, 7, 3), [:federal_reserve], [:observed])[0] || {})[:name]
80
+ assert_equal "Independence Day", (Holidays.on(Date.civil(2015, 7, 3), [:federalreserve], [:observed])[0] || {})[:name]
81
81
 
82
- assert_equal "Labor Day", (Holidays.on(Date.civil(2015, 9, 7), [:federal_reserve], [:observed])[0] || {})[:name]
82
+ assert_equal "Labor Day", (Holidays.on(Date.civil(2015, 9, 7), [:federalreserve], [:observed])[0] || {})[:name]
83
83
 
84
- assert_equal "Columbus Day", (Holidays.on(Date.civil(2015, 10, 12), [:federal_reserve], [:observed])[0] || {})[:name]
84
+ assert_equal "Columbus Day", (Holidays.on(Date.civil(2015, 10, 12), [:federalreserve], [:observed])[0] || {})[:name]
85
85
 
86
- assert_equal "Veterans Day", (Holidays.on(Date.civil(2015, 11, 11), [:federal_reserve], [:observed])[0] || {})[:name]
86
+ assert_equal "Veterans Day", (Holidays.on(Date.civil(2015, 11, 11), [:federalreserve], [:observed])[0] || {})[:name]
87
87
 
88
- assert_equal "Thanksgiving Day", (Holidays.on(Date.civil(2015, 11, 26), [:federal_reserve], [:observed])[0] || {})[:name]
88
+ assert_equal "Thanksgiving Day", (Holidays.on(Date.civil(2015, 11, 26), [:federalreserve], [:observed])[0] || {})[:name]
89
89
 
90
- assert_equal "Christmas Day", (Holidays.on(Date.civil(2015, 12, 25), [:federal_reserve], [:observed])[0] || {})[:name]
90
+ assert_equal "Christmas Day", (Holidays.on(Date.civil(2015, 12, 25), [:federalreserve], [:observed])[0] || {})[:name]
91
91
 
92
- assert_equal "New Year's Day", (Holidays.on(Date.civil(2016, 1, 1), [:federal_reserve], [:observed])[0] || {})[:name]
92
+ assert_equal "New Year's Day", (Holidays.on(Date.civil(2016, 1, 1), [:federalreserve], [:observed])[0] || {})[:name]
93
93
 
94
- assert_equal "Birthday of Martin Luther King, Jr", (Holidays.on(Date.civil(2016, 1, 18), [:federal_reserve], [:observed])[0] || {})[:name]
94
+ assert_equal "Birthday of Martin Luther King, Jr", (Holidays.on(Date.civil(2016, 1, 18), [:federalreserve], [:observed])[0] || {})[:name]
95
95
 
96
- assert_equal "Washington's Birthday", (Holidays.on(Date.civil(2016, 2, 15), [:federal_reserve], [:observed])[0] || {})[:name]
96
+ assert_equal "Washington's Birthday", (Holidays.on(Date.civil(2016, 2, 15), [:federalreserve], [:observed])[0] || {})[:name]
97
97
 
98
- assert_equal "Memorial Day", (Holidays.on(Date.civil(2016, 5, 30), [:federal_reserve], [:observed])[0] || {})[:name]
98
+ assert_equal "Memorial Day", (Holidays.on(Date.civil(2016, 5, 30), [:federalreserve], [:observed])[0] || {})[:name]
99
99
 
100
- assert_equal "Independence Day", (Holidays.on(Date.civil(2016, 7, 4), [:federal_reserve], [:observed])[0] || {})[:name]
100
+ assert_equal "Independence Day", (Holidays.on(Date.civil(2016, 7, 4), [:federalreserve], [:observed])[0] || {})[:name]
101
101
 
102
- assert_equal "Labor Day", (Holidays.on(Date.civil(2016, 9, 5), [:federal_reserve], [:observed])[0] || {})[:name]
102
+ assert_equal "Labor Day", (Holidays.on(Date.civil(2016, 9, 5), [:federalreserve], [:observed])[0] || {})[:name]
103
103
 
104
- assert_equal "Columbus Day", (Holidays.on(Date.civil(2016, 10, 10), [:federal_reserve], [:observed])[0] || {})[:name]
104
+ assert_equal "Columbus Day", (Holidays.on(Date.civil(2016, 10, 10), [:federalreserve], [:observed])[0] || {})[:name]
105
105
 
106
- assert_equal "Veterans Day", (Holidays.on(Date.civil(2016, 11, 11), [:federal_reserve], [:observed])[0] || {})[:name]
106
+ assert_equal "Veterans Day", (Holidays.on(Date.civil(2016, 11, 11), [:federalreserve], [:observed])[0] || {})[:name]
107
107
 
108
- assert_equal "Thanksgiving Day", (Holidays.on(Date.civil(2016, 11, 24), [:federal_reserve], [:observed])[0] || {})[:name]
108
+ assert_equal "Thanksgiving Day", (Holidays.on(Date.civil(2016, 11, 24), [:federalreserve], [:observed])[0] || {})[:name]
109
109
 
110
- assert_equal "Christmas Day", (Holidays.on(Date.civil(2016, 12, 26), [:federal_reserve], [:observed])[0] || {})[:name]
110
+ assert_equal "Christmas Day", (Holidays.on(Date.civil(2016, 12, 26), [:federalreserve], [:observed])[0] || {})[:name]
111
111
 
112
112
  end
113
113
  end
@@ -0,0 +1,113 @@
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: definitions/federalreservebanks.yaml
7
+ class FederalreservebanksDefinitionTests < Test::Unit::TestCase # :nodoc:
8
+
9
+ def test_federalreservebanks
10
+ assert_equal "New Year's Day", (Holidays.on(Date.civil(2012, 1, 2), [:federalreservebanks], [:observed])[0] || {})[:name]
11
+
12
+ assert_equal "Birthday of Martin Luther King, Jr", (Holidays.on(Date.civil(2012, 1, 16), [:federalreservebanks], [:observed])[0] || {})[:name]
13
+
14
+ assert_equal "Washington's Birthday", (Holidays.on(Date.civil(2012, 2, 20), [:federalreservebanks], [:observed])[0] || {})[:name]
15
+
16
+ assert_equal "Memorial Day", (Holidays.on(Date.civil(2012, 5, 28), [:federalreservebanks], [:observed])[0] || {})[:name]
17
+
18
+ assert_equal "Independence Day", (Holidays.on(Date.civil(2012, 7, 4), [:federalreservebanks], [:observed])[0] || {})[:name]
19
+
20
+ assert_equal "Independence Day", (Holidays.on(Date.civil(2020, 7, 3), [:federalreservebanks], [:observed])[0] || {})[:name]
21
+
22
+ assert_equal "Labor Day", (Holidays.on(Date.civil(2012, 9, 3), [:federalreservebanks], [:observed])[0] || {})[:name]
23
+
24
+ assert_equal "Columbus Day", (Holidays.on(Date.civil(2012, 10, 8), [:federalreservebanks], [:observed])[0] || {})[:name]
25
+
26
+ assert_equal "Veterans Day", (Holidays.on(Date.civil(2012, 11, 12), [:federalreservebanks], [:observed])[0] || {})[:name]
27
+
28
+ assert_equal "Thanksgiving Day", (Holidays.on(Date.civil(2012, 11, 22), [:federalreservebanks], [:observed])[0] || {})[:name]
29
+
30
+ assert_equal "Christmas Day", (Holidays.on(Date.civil(2012, 12, 25), [:federalreservebanks], [:observed])[0] || {})[:name]
31
+
32
+ assert_equal "New Year's Day", (Holidays.on(Date.civil(2013, 1, 1), [:federalreservebanks], [:observed])[0] || {})[:name]
33
+
34
+ assert_equal "Birthday of Martin Luther King, Jr", (Holidays.on(Date.civil(2013, 1, 21), [:federalreservebanks], [:observed])[0] || {})[:name]
35
+
36
+ assert_equal "Washington's Birthday", (Holidays.on(Date.civil(2013, 2, 18), [:federalreservebanks], [:observed])[0] || {})[:name]
37
+
38
+ assert_equal "Memorial Day", (Holidays.on(Date.civil(2013, 5, 27), [:federalreservebanks], [:observed])[0] || {})[:name]
39
+
40
+ assert_equal "Independence Day", (Holidays.on(Date.civil(2013, 7, 4), [:federalreservebanks], [:observed])[0] || {})[:name]
41
+
42
+ assert_equal "Labor Day", (Holidays.on(Date.civil(2013, 9, 2), [:federalreservebanks], [:observed])[0] || {})[:name]
43
+
44
+ assert_equal "Columbus Day", (Holidays.on(Date.civil(2013, 10, 14), [:federalreservebanks], [:observed])[0] || {})[:name]
45
+
46
+ assert_equal "Veterans Day", (Holidays.on(Date.civil(2013, 11, 11), [:federalreservebanks], [:observed])[0] || {})[:name]
47
+
48
+ assert_equal "Thanksgiving Day", (Holidays.on(Date.civil(2013, 11, 28), [:federalreservebanks], [:observed])[0] || {})[:name]
49
+
50
+ assert_equal "Christmas Day", (Holidays.on(Date.civil(2013, 12, 25), [:federalreservebanks], [:observed])[0] || {})[:name]
51
+
52
+ assert_equal "New Year's Day", (Holidays.on(Date.civil(2014, 1, 1), [:federalreservebanks], [:observed])[0] || {})[:name]
53
+
54
+ assert_equal "Birthday of Martin Luther King, Jr", (Holidays.on(Date.civil(2014, 1, 20), [:federalreservebanks], [:observed])[0] || {})[:name]
55
+
56
+ assert_equal "Washington's Birthday", (Holidays.on(Date.civil(2014, 2, 17), [:federalreservebanks], [:observed])[0] || {})[:name]
57
+
58
+ assert_equal "Memorial Day", (Holidays.on(Date.civil(2014, 5, 26), [:federalreservebanks], [:observed])[0] || {})[:name]
59
+
60
+ assert_equal "Independence Day", (Holidays.on(Date.civil(2014, 7, 4), [:federalreservebanks], [:observed])[0] || {})[:name]
61
+
62
+ assert_equal "Labor Day", (Holidays.on(Date.civil(2014, 9, 1), [:federalreservebanks], [:observed])[0] || {})[:name]
63
+
64
+ assert_equal "Columbus Day", (Holidays.on(Date.civil(2014, 10, 13), [:federalreservebanks], [:observed])[0] || {})[:name]
65
+
66
+ assert_equal "Veterans Day", (Holidays.on(Date.civil(2014, 11, 11), [:federalreservebanks], [:observed])[0] || {})[:name]
67
+
68
+ assert_equal "Thanksgiving Day", (Holidays.on(Date.civil(2014, 11, 27), [:federalreservebanks], [:observed])[0] || {})[:name]
69
+
70
+ assert_equal "Christmas Day", (Holidays.on(Date.civil(2014, 12, 25), [:federalreservebanks], [:observed])[0] || {})[:name]
71
+
72
+ assert_equal "New Year's Day", (Holidays.on(Date.civil(2015, 1, 1), [:federalreservebanks], [:observed])[0] || {})[:name]
73
+
74
+ assert_equal "Birthday of Martin Luther King, Jr", (Holidays.on(Date.civil(2015, 1, 19), [:federalreservebanks], [:observed])[0] || {})[:name]
75
+
76
+ assert_equal "Washington's Birthday", (Holidays.on(Date.civil(2015, 2, 16), [:federalreservebanks], [:observed])[0] || {})[:name]
77
+
78
+ assert_equal "Memorial Day", (Holidays.on(Date.civil(2015, 5, 25), [:federalreservebanks], [:observed])[0] || {})[:name]
79
+
80
+ assert_equal "Independence Day", (Holidays.on(Date.civil(2015, 7, 3), [:federalreservebanks], [:observed])[0] || {})[:name]
81
+
82
+ assert_equal "Labor Day", (Holidays.on(Date.civil(2015, 9, 7), [:federalreservebanks], [:observed])[0] || {})[:name]
83
+
84
+ assert_equal "Columbus Day", (Holidays.on(Date.civil(2015, 10, 12), [:federalreservebanks], [:observed])[0] || {})[:name]
85
+
86
+ assert_equal "Veterans Day", (Holidays.on(Date.civil(2015, 11, 11), [:federalreservebanks], [:observed])[0] || {})[:name]
87
+
88
+ assert_equal "Thanksgiving Day", (Holidays.on(Date.civil(2015, 11, 26), [:federalreservebanks], [:observed])[0] || {})[:name]
89
+
90
+ assert_equal "Christmas Day", (Holidays.on(Date.civil(2015, 12, 25), [:federalreservebanks], [:observed])[0] || {})[:name]
91
+
92
+ assert_equal "New Year's Day", (Holidays.on(Date.civil(2016, 1, 1), [:federalreservebanks], [:observed])[0] || {})[:name]
93
+
94
+ assert_equal "Birthday of Martin Luther King, Jr", (Holidays.on(Date.civil(2016, 1, 18), [:federalreservebanks], [:observed])[0] || {})[:name]
95
+
96
+ assert_equal "Washington's Birthday", (Holidays.on(Date.civil(2016, 2, 15), [:federalreservebanks], [:observed])[0] || {})[:name]
97
+
98
+ assert_equal "Memorial Day", (Holidays.on(Date.civil(2016, 5, 30), [:federalreservebanks], [:observed])[0] || {})[:name]
99
+
100
+ assert_equal "Independence Day", (Holidays.on(Date.civil(2016, 7, 4), [:federalreservebanks], [:observed])[0] || {})[:name]
101
+
102
+ assert_equal "Labor Day", (Holidays.on(Date.civil(2016, 9, 5), [:federalreservebanks], [:observed])[0] || {})[:name]
103
+
104
+ assert_equal "Columbus Day", (Holidays.on(Date.civil(2016, 10, 10), [:federalreservebanks], [:observed])[0] || {})[:name]
105
+
106
+ assert_equal "Veterans Day", (Holidays.on(Date.civil(2016, 11, 11), [:federalreservebanks], [:observed])[0] || {})[:name]
107
+
108
+ assert_equal "Thanksgiving Day", (Holidays.on(Date.civil(2016, 11, 24), [:federalreservebanks], [:observed])[0] || {})[:name]
109
+
110
+ assert_equal "Christmas Day", (Holidays.on(Date.civil(2016, 12, 26), [:federalreservebanks], [:observed])[0] || {})[:name]
111
+
112
+ end
113
+ end