holidays 5.7.0 → 6.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (98) hide show
  1. checksums.yaml +4 -4
  2. data/.gitmodules +1 -1
  3. data/CHANGELOG.md +11 -0
  4. data/lib/generated_definitions/north_america.rb +1 -1
  5. data/lib/generated_definitions/tr.rb +1 -0
  6. data/lib/generated_definitions/us.rb +1 -1
  7. data/lib/holidays/definition/context/generator.rb +5 -36
  8. data/lib/holidays/definition/decorator/test.rb +37 -0
  9. data/lib/holidays/definition/entity/test.rb +11 -0
  10. data/lib/holidays/definition/generator/test.rb +51 -0
  11. data/lib/holidays/definition/parser/test.rb +86 -0
  12. data/lib/holidays/definition/validator/test.rb +71 -0
  13. data/lib/holidays/errors.rb +3 -0
  14. data/lib/holidays/factory/definition.rb +24 -0
  15. data/lib/holidays/version.rb +1 -1
  16. data/test/coverage_report.rb +1 -0
  17. data/test/data/test_custom_year_range_holiday_defs.yaml +7 -0
  18. data/test/data/test_multiple_custom_holiday_defs.yaml +7 -4
  19. data/test/data/test_single_custom_holiday_defs.yaml +7 -4
  20. data/test/data/test_single_custom_holiday_with_custom_procs.yaml +11 -7
  21. data/test/defs/test_defs_ar.rb +33 -19
  22. data/test/defs/test_defs_at.rb +14 -11
  23. data/test/defs/test_defs_au.rb +172 -141
  24. data/test/defs/test_defs_be_fr.rb +23 -14
  25. data/test/defs/test_defs_be_nl.rb +23 -14
  26. data/test/defs/test_defs_bg.rb +29 -17
  27. data/test/defs/test_defs_br.rb +33 -19
  28. data/test/defs/test_defs_ca.rb +175 -176
  29. data/test/defs/test_defs_ch.rb +29 -23
  30. data/test/defs/test_defs_cl.rb +49 -27
  31. data/test/defs/test_defs_cr.rb +17 -11
  32. data/test/defs/test_defs_cz.rb +25 -15
  33. data/test/defs/test_defs_de.rb +52 -61
  34. data/test/defs/test_defs_dk.rb +31 -19
  35. data/test/defs/test_defs_ecb_target.rb +14 -10
  36. data/test/defs/test_defs_ee.rb +28 -20
  37. data/test/defs/test_defs_el.rb +29 -17
  38. data/test/defs/test_defs_es.rb +114 -52
  39. data/test/defs/test_defs_europe.rb +1154 -715
  40. data/test/defs/test_defs_federal_reserve.rb +99 -57
  41. data/test/defs/test_defs_fedex.rb +19 -12
  42. data/test/defs/test_defs_fi.rb +47 -27
  43. data/test/defs/test_defs_fr.rb +29 -24
  44. data/test/defs/test_defs_gb.rb +90 -51
  45. data/test/defs/test_defs_ge.rb +40 -28
  46. data/test/defs/test_defs_hk.rb +47 -26
  47. data/test/defs/test_defs_hr.rb +32 -18
  48. data/test/defs/test_defs_hu.rb +26 -16
  49. data/test/defs/test_defs_ie.rb +41 -25
  50. data/test/defs/test_defs_is.rb +39 -22
  51. data/test/defs/test_defs_it.rb +23 -14
  52. data/test/defs/test_defs_jp.rb +112 -59
  53. data/test/defs/test_defs_kr.rb +25 -17
  54. data/test/defs/test_defs_li.rb +20 -20
  55. data/test/defs/test_defs_lt.rb +51 -30
  56. data/test/defs/test_defs_lu.rb +17 -12
  57. data/test/defs/test_defs_ma.rb +17 -11
  58. data/test/defs/test_defs_mt_en.rb +28 -19
  59. data/test/defs/test_defs_mt_mt.rb +28 -19
  60. data/test/defs/test_defs_mx.rb +33 -22
  61. data/test/defs/test_defs_my.rb +11 -8
  62. data/test/defs/test_defs_nerc.rb +17 -11
  63. data/test/defs/test_defs_nl.rb +21 -13
  64. data/test/defs/test_defs_no.rb +31 -18
  65. data/test/defs/test_defs_north_america.rb +507 -393
  66. data/test/defs/test_defs_nyse.rb +26 -15
  67. data/test/defs/test_defs_nz.rb +47 -28
  68. data/test/defs/test_defs_pe.rb +35 -20
  69. data/test/defs/test_defs_ph.rb +17 -11
  70. data/test/defs/test_defs_pl.rb +200 -119
  71. data/test/defs/test_defs_pt.rb +33 -24
  72. data/test/defs/test_defs_ro.rb +39 -24
  73. data/test/defs/test_defs_rs_cyrl.rb +33 -26
  74. data/test/defs/test_defs_rs_la.rb +33 -26
  75. data/test/defs/test_defs_ru.rb +22 -16
  76. data/test/defs/test_defs_scandinavia.rb +193 -116
  77. data/test/defs/test_defs_se.rb +47 -28
  78. data/test/defs/test_defs_sg.rb +13 -9
  79. data/test/defs/test_defs_si.rb +93 -24
  80. data/test/defs/test_defs_sk.rb +29 -17
  81. data/test/defs/test_defs_tn.rb +15 -10
  82. data/test/defs/test_defs_tr.rb +39 -30
  83. data/test/defs/test_defs_united_nations.rb +0 -1
  84. data/test/defs/test_defs_ups.rb +19 -12
  85. data/test/defs/test_defs_us.rb +333 -217
  86. data/test/defs/test_defs_ve.rb +23 -16
  87. data/test/defs/test_defs_vi.rb +10 -8
  88. data/test/defs/test_defs_za.rb +23 -14
  89. data/test/holidays/definition/context/test_generator.rb +40 -13
  90. data/test/holidays/definition/decorator/test_test.rb +123 -0
  91. data/test/holidays/definition/generator/test_test.rb +113 -0
  92. data/test/holidays/definition/parser/test_test.rb +142 -0
  93. data/test/holidays/definition/validator/test_region.rb +5 -0
  94. data/test/holidays/definition/validator/test_test.rb +60 -0
  95. metadata +15 -8
  96. data/test/holidays/factory/test_date_calculator.rb +0 -32
  97. data/test/holidays/factory/test_definition.rb +0 -62
  98. data/test/holidays/factory/test_finder.rb +0 -25
@@ -7,32 +7,41 @@ require File.expand_path(File.dirname(__FILE__)) + '/../test_helper'
7
7
  class PtDefinitionTests < Test::Unit::TestCase # :nodoc:
8
8
 
9
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(2016, 3, 27) => 'Páscoa',
18
- Date.civil(2008, 4, 25) => 'Dia da Liberdade',
19
- Date.civil(2008, 5, 1) => 'Dia do Trabalhador',
20
- Date.civil(2016, 5, 26) => 'Corpo de Deus',
21
- Date.civil(2008, 6, 10) => 'Dia de Portugal',
22
- Date.civil(2008, 8, 15) => 'Assunção de Nossa Senhora',
23
- Date.civil(2008, 10, 5) => 'Dia da República',
24
- Date.civil(2008, 11, 1) => 'Dia de Todos-os-Santos',
25
- Date.civil(2008, 12, 1) => 'Restauração da Independência',
26
- Date.civil(2008, 12, 8) => 'Imaculada Conceição',
27
- Date.civil(2008, 12, 25) => 'Natal' }.each do |date, name|
28
- assert_equal name, (Holidays.on(date, :pt, :informal)[0] || {})[:name]
29
- end
10
+ assert_equal "Ano Novo", (Holidays.on(Date.civil(2008, 1, 1), [:pt], [:informal])[0] || {})[:name]
11
+
12
+ assert_equal "Carnaval", (Holidays.on(Date.civil(2005, 2, 8), [:pt], [:informal])[0] || {})[:name]
13
+
14
+ assert_equal "Carnaval", (Holidays.on(Date.civil(2006, 2, 28), [:pt], [:informal])[0] || {})[:name]
15
+
16
+ assert_equal "Carnaval", (Holidays.on(Date.civil(2007, 2, 20), [:pt], [:informal])[0] || {})[:name]
17
+
18
+ assert_equal "Carnaval", (Holidays.on(Date.civil(2008, 2, 5), [:pt], [:informal])[0] || {})[:name]
19
+
20
+ assert_equal "Sexta-feira Santa", (Holidays.on(Date.civil(2008, 3, 21), [:pt], [:informal])[0] || {})[:name]
21
+
22
+ assert_equal "Páscoa", (Holidays.on(Date.civil(2008, 3, 23), [:pt], [:informal])[0] || {})[:name]
23
+
24
+ assert_equal "Páscoa", (Holidays.on(Date.civil(2016, 3, 27), [:pt], [:informal])[0] || {})[:name]
25
+
26
+ assert_equal "Dia da Liberdade", (Holidays.on(Date.civil(2008, 4, 25), [:pt], [:informal])[0] || {})[:name]
27
+
28
+ assert_equal "Dia do Trabalhador", (Holidays.on(Date.civil(2008, 5, 1), [:pt], [:informal])[0] || {})[:name]
29
+
30
+ assert_equal "Corpo de Deus", (Holidays.on(Date.civil(2016, 5, 26), [:pt], [:informal])[0] || {})[:name]
31
+
32
+ assert_equal "Dia de Portugal", (Holidays.on(Date.civil(2008, 6, 10), [:pt], [:informal])[0] || {})[:name]
33
+
34
+ assert_equal "Assunção de Nossa Senhora", (Holidays.on(Date.civil(2008, 8, 15), [:pt], [:informal])[0] || {})[:name]
35
+
36
+ assert_equal "Dia da República", (Holidays.on(Date.civil(2008, 10, 5), [:pt], [:informal])[0] || {})[:name]
37
+
38
+ assert_equal "Dia de Todos-os-Santos", (Holidays.on(Date.civil(2008, 11, 1), [:pt], [:informal])[0] || {})[:name]
39
+
40
+ assert_equal "Restauração da Independência", (Holidays.on(Date.civil(2008, 12, 1), [:pt], [:informal])[0] || {})[:name]
30
41
 
31
- assert_nil Holidays.on(Date.civil(2017, 6, 13), [:pt])[0] || {}[:name]
32
- assert_equal 'Dia de Santo António', Holidays.on(Date.civil(2017, 6, 13), [:pt_li])[0][:name]
42
+ assert_equal "Imaculada Conceição", (Holidays.on(Date.civil(2008, 12, 8), [:pt], [:informal])[0] || {})[:name]
33
43
 
34
- assert_nil Holidays.on(Date.civil(2017, 6, 24), [:pt])[0] || {}[:name]
35
- assert_equal 'Dia de São João', Holidays.on(Date.civil(2017, 6, 24), [:pt_po])[0][:name]
44
+ assert_equal "Natal", (Holidays.on(Date.civil(2008, 12, 25), [:pt], [:informal])[0] || {})[:name]
36
45
 
37
46
  end
38
47
  end
@@ -7,30 +7,45 @@ require File.expand_path(File.dirname(__FILE__)) + '/../test_helper'
7
7
  class RoDefinitionTests < Test::Unit::TestCase # :nodoc:
8
8
 
9
9
  def test_ro
10
- {
11
- Date.civil(1961,4,9) => 'Paștele - duminică',
12
- Date.civil(1961,4,10) => 'Paștele - luni',
13
- Date.civil(2013,5,5) => 'Paștele - duminică',
14
- Date.civil(2013,5,6) => 'Paștele - luni',
15
- Date.civil(2027,5,2) => 'Paștele - duminică',
16
- Date.civil(2027,5,3) => 'Paștele - luni',
17
- Date.civil(2012,6,4) => 'Rusaliile - 51',
18
- Date.civil(2013,6,23) => 'Rusaliile - 50',
19
- Date.civil(2013,6,24) => 'Rusaliile - 51',
20
- Date.civil(1986,6,22) => 'Rusaliile - 50',
21
- Date.civil(1986,6,23) => 'Rusaliile - 51',
22
- Date.civil(2009,1,1) => 'Anul nou',
23
- Date.civil(2014,1,2) => 'Anul nou',
24
- Date.civil(2009,5,1) => 'Ziua muncii',
25
- Date.civil(2012,8,15) => 'Adormirea Maicii Domnului',
26
- Date.civil(2013,11,30) => 'Sfântul Apostol Andrei',
27
- Date.civil(2013,12,1) => 'Ziua Națională',
28
- Date.civil(2013,12,25) => 'Sărbătoarea Nașterii Domnului',
29
- Date.civil(2013,12,26) => 'Sărbătoarea Nașterii Domnului'}.each do |date, name|
30
- assert_equal name, (Holidays.on(date, :ro, :informal)[0] || {})[:name]
31
- end
32
-
33
- assert_equal [], Holidays.on(Date.civil(2013,7,23), :ro), '2013-07-23 is not a holiday in Romania'
10
+ assert_equal "Paștele - duminică", (Holidays.on(Date.civil(1961, 4, 9), [:ro], [:informal])[0] || {})[:name]
11
+
12
+ assert_equal "Paștele - luni", (Holidays.on(Date.civil(1961, 4, 10), [:ro], [:informal])[0] || {})[:name]
13
+
14
+ assert_equal "Paștele - duminică", (Holidays.on(Date.civil(2013, 5, 5), [:ro], [:informal])[0] || {})[:name]
15
+
16
+ assert_equal "Paștele - luni", (Holidays.on(Date.civil(2013, 5, 6), [:ro], [:informal])[0] || {})[:name]
17
+
18
+ assert_equal "Paștele - duminică", (Holidays.on(Date.civil(2027, 5, 2), [:ro], [:informal])[0] || {})[:name]
19
+
20
+ assert_equal "Paștele - luni", (Holidays.on(Date.civil(2027, 5, 3), [:ro], [:informal])[0] || {})[:name]
21
+
22
+ assert_equal "Rusaliile - 51", (Holidays.on(Date.civil(2012, 6, 4), [:ro], [:informal])[0] || {})[:name]
23
+
24
+ assert_equal "Rusaliile - 50", (Holidays.on(Date.civil(2013, 6, 23), [:ro], [:informal])[0] || {})[:name]
25
+
26
+ assert_equal "Rusaliile - 51", (Holidays.on(Date.civil(2013, 6, 24), [:ro], [:informal])[0] || {})[:name]
27
+
28
+ assert_equal "Rusaliile - 50", (Holidays.on(Date.civil(1986, 6, 22), [:ro], [:informal])[0] || {})[:name]
29
+
30
+ assert_equal "Rusaliile - 51", (Holidays.on(Date.civil(1986, 6, 23), [:ro], [:informal])[0] || {})[:name]
31
+
32
+ assert_equal "Anul nou", (Holidays.on(Date.civil(2009, 1, 1), [:ro], [:informal])[0] || {})[:name]
33
+
34
+ assert_equal "Anul nou", (Holidays.on(Date.civil(2014, 1, 2), [:ro], [:informal])[0] || {})[:name]
35
+
36
+ assert_equal "Ziua muncii", (Holidays.on(Date.civil(2009, 5, 1), [:ro], [:informal])[0] || {})[:name]
37
+
38
+ assert_equal "Adormirea Maicii Domnului", (Holidays.on(Date.civil(2012, 8, 15), [:ro], [:informal])[0] || {})[:name]
39
+
40
+ assert_equal "Sfântul Apostol Andrei", (Holidays.on(Date.civil(2013, 11, 30), [:ro], [:informal])[0] || {})[:name]
41
+
42
+ assert_equal "Ziua Națională", (Holidays.on(Date.civil(2013, 12, 1), [:ro], [:informal])[0] || {})[:name]
43
+
44
+ assert_equal "Sărbătoarea Nașterii Domnului", (Holidays.on(Date.civil(2013, 12, 25), [:ro], [:informal])[0] || {})[:name]
45
+
46
+ assert_equal "Sărbătoarea Nașterii Domnului", (Holidays.on(Date.civil(2013, 12, 26), [:ro], [:informal])[0] || {})[:name]
47
+
48
+ assert_nil (Holidays.on(Date.civil(2013, 7, 23), [:ro])[0] || {})[:name]
34
49
 
35
50
  end
36
51
  end
@@ -7,33 +7,40 @@ require File.expand_path(File.dirname(__FILE__)) + '/../test_helper'
7
7
  class Rs_cyrlDefinitionTests < Test::Unit::TestCase # :nodoc:
8
8
 
9
9
  def test_rs_cyrl
10
- { Date.civil(2017, 1, 1) => 'Нова Година',
11
- Date.civil(2017, 1, 2) => 'Нова Година',
12
- Date.civil(2017, 1, 7) => 'Божић',
13
- Date.civil(2017, 1, 27) => 'Свети Сава (Савиндан)',
14
- Date.civil(2017, 2, 15) => 'Дан државности Србије',
15
- Date.civil(2017, 2, 16) => 'Дан државности Србије',
16
- Date.civil(2017, 5, 1) => 'Празник рада',
17
- Date.civil(2017, 5, 2) => 'Празник рада',
18
- Date.civil(2017, 5, 9) => 'Дан победе над фашизмом',
19
- Date.civil(2017, 6, 28) => 'Видовдан',
20
- Date.civil(2017, 11, 11) => 'Дан примирја'
21
- }.each do |date, name|
22
- assert_equal name, (Holidays.on(date, :rs_cyrl)[0] || {})[:name]
23
- end
10
+ assert_equal "Нова Година", (Holidays.on(Date.civil(2017, 1, 1), [:rs_cyrl])[0] || {})[:name]
11
+ assert_equal "Нова Година", (Holidays.on(Date.civil(2017, 1, 2), [:rs_cyrl])[0] || {})[:name]
24
12
 
25
- [Date.civil(2017, 4, 14), Date.civil(2018, 4, 6), Date.civil(2019, 4, 26)].each do |date|
26
- assert_equal 'Велики петак', Holidays.on(date, :rs_cyrl)[0][:name]
27
- end
28
- [Date.civil(2017, 4, 15), Date.civil(2018, 4, 7), Date.civil(2019, 4, 27)].each do |date|
29
- assert_equal 'Велика Субота', Holidays.on(date, :rs_cyrl)[0][:name]
30
- end
31
- [Date.civil(2017, 4, 16), Date.civil(2018, 4, 8), Date.civil(2019, 4, 28)].each do |date|
32
- assert_equal 'Васкрс', Holidays.on(date, :rs_cyrl)[0][:name]
33
- end
34
- [Date.civil(2017, 4, 17), Date.civil(2018, 4, 9), Date.civil(2019, 4, 29)].each do |date|
35
- assert_equal 'Васкрсни понедељак', Holidays.on(date, :rs_cyrl)[0][:name]
36
- end
13
+ assert_equal "Божић", (Holidays.on(Date.civil(2017, 1, 7), [:rs_cyrl])[0] || {})[:name]
14
+
15
+ assert_equal "Свети Сава (Савиндан)", (Holidays.on(Date.civil(2017, 1, 27), [:rs_cyrl])[0] || {})[:name]
16
+
17
+ assert_equal "Дан државности Србије", (Holidays.on(Date.civil(2017, 2, 15), [:rs_cyrl])[0] || {})[:name]
18
+ assert_equal "Дан државности Србије", (Holidays.on(Date.civil(2017, 2, 16), [:rs_cyrl])[0] || {})[:name]
19
+
20
+ assert_equal "Празник рада", (Holidays.on(Date.civil(2017, 5, 1), [:rs_cyrl])[0] || {})[:name]
21
+ assert_equal "Празник рада", (Holidays.on(Date.civil(2017, 5, 2), [:rs_cyrl])[0] || {})[:name]
22
+
23
+ assert_equal "Дан победе над фашизмом", (Holidays.on(Date.civil(2017, 5, 9), [:rs_cyrl])[0] || {})[:name]
24
+
25
+ assert_equal "Видовдан", (Holidays.on(Date.civil(2017, 6, 28), [:rs_cyrl])[0] || {})[:name]
26
+
27
+ assert_equal "Дан примирја", (Holidays.on(Date.civil(2017, 11, 11), [:rs_cyrl])[0] || {})[:name]
28
+
29
+ assert_equal "Велики петак", (Holidays.on(Date.civil(2017, 4, 14), [:rs_cyrl])[0] || {})[:name]
30
+ assert_equal "Велики петак", (Holidays.on(Date.civil(2018, 4, 6), [:rs_cyrl])[0] || {})[:name]
31
+ assert_equal "Велики петак", (Holidays.on(Date.civil(2019, 4, 26), [:rs_cyrl])[0] || {})[:name]
32
+
33
+ assert_equal "Велика Субота", (Holidays.on(Date.civil(2017, 4, 15), [:rs_cyrl])[0] || {})[:name]
34
+ assert_equal "Велика Субота", (Holidays.on(Date.civil(2018, 4, 7), [:rs_cyrl])[0] || {})[:name]
35
+ assert_equal "Велика Субота", (Holidays.on(Date.civil(2019, 4, 27), [:rs_cyrl])[0] || {})[:name]
36
+
37
+ assert_equal "Васкрс", (Holidays.on(Date.civil(2017, 4, 16), [:rs_cyrl])[0] || {})[:name]
38
+ assert_equal "Васкрс", (Holidays.on(Date.civil(2018, 4, 8), [:rs_cyrl])[0] || {})[:name]
39
+ assert_equal "Васкрс", (Holidays.on(Date.civil(2019, 4, 28), [:rs_cyrl])[0] || {})[:name]
40
+
41
+ assert_equal "Васкрсни понедељак", (Holidays.on(Date.civil(2017, 4, 17), [:rs_cyrl])[0] || {})[:name]
42
+ assert_equal "Васкрсни понедељак", (Holidays.on(Date.civil(2018, 4, 9), [:rs_cyrl])[0] || {})[:name]
43
+ assert_equal "Васкрсни понедељак", (Holidays.on(Date.civil(2019, 4, 29), [:rs_cyrl])[0] || {})[:name]
37
44
 
38
45
  end
39
46
  end
@@ -7,33 +7,40 @@ require File.expand_path(File.dirname(__FILE__)) + '/../test_helper'
7
7
  class Rs_laDefinitionTests < Test::Unit::TestCase # :nodoc:
8
8
 
9
9
  def test_rs_la
10
- { Date.civil(2017, 1, 1) => 'Nova Godina',
11
- Date.civil(2017, 1, 2) => 'Nova Godina',
12
- Date.civil(2017, 1, 7) => 'Božić',
13
- Date.civil(2017, 1, 27) => 'Dan Svetog Save',
14
- Date.civil(2017, 2, 15) => 'Dan državnosti Srbije',
15
- Date.civil(2017, 2, 16) => 'Dan državnosti Srbije',
16
- Date.civil(2017, 5, 1) => 'Praznik rada',
17
- Date.civil(2017, 5, 2) => 'Praznik rada',
18
- Date.civil(2017, 5, 9) => 'Dan pobede',
19
- Date.civil(2017, 6, 28) => 'Vidovdan',
20
- Date.civil(2017, 11, 11) => 'Dan primirja'
21
- }.each do |date, name|
22
- assert_equal name, (Holidays.on(date, :rs_la)[0] || {})[:name]
23
- end
10
+ assert_equal "Nova Godina", (Holidays.on(Date.civil(2017, 1, 1), [:rs_la])[0] || {})[:name]
11
+ assert_equal "Nova Godina", (Holidays.on(Date.civil(2017, 1, 2), [:rs_la])[0] || {})[:name]
24
12
 
25
- [Date.civil(2017, 4, 14), Date.civil(2018, 4, 6), Date.civil(2019, 4, 26)].each do |date|
26
- assert_equal 'Veliki Petak', Holidays.on(date, :rs_la)[0][:name]
27
- end
28
- [Date.civil(2017, 4, 15), Date.civil(2018, 4, 7), Date.civil(2019, 4, 27)].each do |date|
29
- assert_equal 'Velika Subota', Holidays.on(date, :rs_la)[0][:name]
30
- end
31
- [Date.civil(2017, 4, 16), Date.civil(2018, 4, 8), Date.civil(2019, 4, 28)].each do |date|
32
- assert_equal 'Uskrs', Holidays.on(date, :rs_la)[0][:name]
33
- end
34
- [Date.civil(2017, 4, 17), Date.civil(2018, 4, 9), Date.civil(2019, 4, 29)].each do |date|
35
- assert_equal 'Vaskrsni ponedeljak', Holidays.on(date, :rs_la)[0][:name]
36
- end
13
+ assert_equal "Božić", (Holidays.on(Date.civil(2017, 1, 7), [:rs_la])[0] || {})[:name]
14
+
15
+ assert_equal "Dan Svetog Save", (Holidays.on(Date.civil(2017, 1, 27), [:rs_la])[0] || {})[:name]
16
+
17
+ assert_equal "Dan državnosti Srbije", (Holidays.on(Date.civil(2017, 2, 15), [:rs_la])[0] || {})[:name]
18
+ assert_equal "Dan državnosti Srbije", (Holidays.on(Date.civil(2017, 2, 16), [:rs_la])[0] || {})[:name]
19
+
20
+ assert_equal "Praznik rada", (Holidays.on(Date.civil(2017, 5, 1), [:rs_la])[0] || {})[:name]
21
+ assert_equal "Praznik rada", (Holidays.on(Date.civil(2017, 5, 2), [:rs_la])[0] || {})[:name]
22
+
23
+ assert_equal "Dan pobede", (Holidays.on(Date.civil(2017, 5, 9), [:rs_la])[0] || {})[:name]
24
+
25
+ assert_equal "Vidovdan", (Holidays.on(Date.civil(2017, 6, 28), [:rs_la])[0] || {})[:name]
26
+
27
+ assert_equal "Dan primirja", (Holidays.on(Date.civil(2017, 11, 11), [:rs_la])[0] || {})[:name]
28
+
29
+ assert_equal "Veliki Petak", (Holidays.on(Date.civil(2017, 4, 14), [:rs_la])[0] || {})[:name]
30
+ assert_equal "Veliki Petak", (Holidays.on(Date.civil(2018, 4, 6), [:rs_la])[0] || {})[:name]
31
+ assert_equal "Veliki Petak", (Holidays.on(Date.civil(2019, 4, 26), [:rs_la])[0] || {})[:name]
32
+
33
+ assert_equal "Velika Subota", (Holidays.on(Date.civil(2017, 4, 15), [:rs_la])[0] || {})[:name]
34
+ assert_equal "Velika Subota", (Holidays.on(Date.civil(2018, 4, 7), [:rs_la])[0] || {})[:name]
35
+ assert_equal "Velika Subota", (Holidays.on(Date.civil(2019, 4, 27), [:rs_la])[0] || {})[:name]
36
+
37
+ assert_equal "Uskrs", (Holidays.on(Date.civil(2017, 4, 16), [:rs_la])[0] || {})[:name]
38
+ assert_equal "Uskrs", (Holidays.on(Date.civil(2018, 4, 8), [:rs_la])[0] || {})[:name]
39
+ assert_equal "Uskrs", (Holidays.on(Date.civil(2019, 4, 28), [:rs_la])[0] || {})[:name]
40
+
41
+ assert_equal "Vaskrsni ponedeljak", (Holidays.on(Date.civil(2017, 4, 17), [:rs_la])[0] || {})[:name]
42
+ assert_equal "Vaskrsni ponedeljak", (Holidays.on(Date.civil(2018, 4, 9), [:rs_la])[0] || {})[:name]
43
+ assert_equal "Vaskrsni ponedeljak", (Holidays.on(Date.civil(2019, 4, 29), [:rs_la])[0] || {})[:name]
37
44
 
38
45
  end
39
46
  end
@@ -7,22 +7,28 @@ require File.expand_path(File.dirname(__FILE__)) + '/../test_helper'
7
7
  class RuDefinitionTests < Test::Unit::TestCase # :nodoc:
8
8
 
9
9
  def test_ru
10
- { Date.civil(2017, 1, 1) => 'Новый год',
11
- Date.civil(2017, 1, 2) => 'Новогодний праздник',
12
- Date.civil(2017, 1, 3) => 'Новогодний праздник',
13
- Date.civil(2017, 1, 4) => 'Новогодний праздник',
14
- Date.civil(2017, 1, 5) => 'Новогодний праздник',
15
- Date.civil(2017, 1, 7) => 'Рождество Христово',
16
- Date.civil(2017, 2, 23) => 'День защитника Отечества',
17
- Date.civil(2017, 3, 8) => 'Международный женский день',
18
- Date.civil(2017, 5, 1) => 'Праздник Весны и Труда',
19
- Date.civil(2017, 5, 9) => 'День Победы',
20
- Date.civil(2017, 6, 12) => 'День России',
21
- Date.civil(2017, 8, 22) => 'День Государственного флага Российской Федерации',
22
- Date.civil(2017, 11, 4) => 'День народного единства'
23
- }.each do |date, name|
24
- assert_equal name, (Holidays.on(date, :ru)[0] || {})[:name]
25
- end
10
+ assert_equal "Новый год", (Holidays.on(Date.civil(2017, 1, 1), [:ru])[0] || {})[:name]
11
+
12
+ assert_equal "Новогодний праздник", (Holidays.on(Date.civil(2017, 1, 2), [:ru])[0] || {})[:name]
13
+ assert_equal "Новогодний праздник", (Holidays.on(Date.civil(2017, 1, 3), [:ru])[0] || {})[:name]
14
+ assert_equal "Новогодний праздник", (Holidays.on(Date.civil(2017, 1, 4), [:ru])[0] || {})[:name]
15
+ assert_equal "Новогодний праздник", (Holidays.on(Date.civil(2017, 1, 5), [:ru])[0] || {})[:name]
16
+
17
+ assert_equal "Рождество Христово", (Holidays.on(Date.civil(2017, 1, 7), [:ru])[0] || {})[:name]
18
+
19
+ assert_equal "День защитника Отечества", (Holidays.on(Date.civil(2017, 2, 23), [:ru])[0] || {})[:name]
20
+
21
+ assert_equal "Международный женский день", (Holidays.on(Date.civil(2017, 3, 8), [:ru])[0] || {})[:name]
22
+
23
+ assert_equal "Праздник Весны и Труда", (Holidays.on(Date.civil(2017, 5, 1), [:ru])[0] || {})[:name]
24
+
25
+ assert_equal "День Победы", (Holidays.on(Date.civil(2017, 5, 9), [:ru])[0] || {})[:name]
26
+
27
+ assert_equal "День России", (Holidays.on(Date.civil(2017, 6, 12), [:ru])[0] || {})[:name]
28
+
29
+ assert_equal "День Государственного флага Российской Федерации", (Holidays.on(Date.civil(2017, 8, 22), [:ru])[0] || {})[:name]
30
+
31
+ assert_equal "День народного единства", (Holidays.on(Date.civil(2017, 11, 4), [:ru])[0] || {})[:name]
26
32
 
27
33
  end
28
34
  end
@@ -7,128 +7,205 @@ require File.expand_path(File.dirname(__FILE__)) + '/../test_helper'
7
7
  class ScandinaviaDefinitionTests < Test::Unit::TestCase # :nodoc:
8
8
 
9
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
10
+ assert_equal "Nytårsdag", (Holidays.on(Date.civil(2007, 1, 1), [:dk], [:informal])[0] || {})[:name]
29
11
 
12
+ assert_equal "Fastelavn", (Holidays.on(Date.civil(2007, 2, 18), [:dk], [:informal])[0] || {})[:name]
30
13
 
31
- {Date.civil(2007,1,1) => 'Nýársdagur',
32
- Date.civil(2007,1,6) => 'Þrettándinn',
33
- Date.civil(2007,1,19) => 'Bóndadagur',
34
- Date.civil(2007,2,18) => 'Konudagur',
35
- Date.civil(2007,4,5) => 'Skírdagur',
36
- Date.civil(2007,4,6) => 'Föstudaginn langi',
37
- Date.civil(2007,4,8) => 'Páskadagur',
38
- Date.civil(2007,4,9) => 'Annar í páskum',
39
- Date.civil(2007,4,19) => 'Sumardagurinn fyrsti',
40
- Date.civil(2007,5,1) => 'Verkalýðsdagurinn',
41
- Date.civil(2007,5,17) => 'Uppstigningardagur',
42
- Date.civil(2007,5,27) => 'Hvítasunnudagur',
43
- Date.civil(2007,5,28) => 'Annar í hvítasunnu',
44
- Date.civil(2007,6,3) => 'Sjómannadagurinn',
45
- Date.civil(2007,6,17) => 'Lýðveldisdagurinn',
46
- Date.civil(2007,8,6) => 'Frídagur verslunarmanna',
47
- Date.civil(2007,12,24) => 'Jól',
48
- Date.civil(2007,12,25) => 'Jól',
49
- Date.civil(2007,12,26) => 'Jól',
50
- Date.civil(2007,12,31) => 'Gamlárskvöld'}.each do |date, name|
51
- assert_equal name, (Holidays.on(date, :is, :informal)[0] || {})[:name]
52
- end
14
+ assert_equal "2. påskedag", (Holidays.on(Date.civil(2007, 4, 9), [:dk], [:informal])[0] || {})[:name]
53
15
 
16
+ assert_equal "Dronningens fødselsdag", (Holidays.on(Date.civil(2007, 4, 16), [:dk], [:informal])[0] || {})[:name]
54
17
 
55
- {Date.civil(2010,1,1) => 'Nyttårsdag',
56
- Date.civil(2010,5,1) => '1. mai',
57
- Date.civil(2010,5,17) => '17. mai',
58
- Date.civil(2010,12,24) => 'Julaften',
59
- Date.civil(2010,12,25) => '1. juledag',
60
- Date.civil(2010,12,26) => '2. juledag',
61
- Date.civil(2010,12,31) => 'Nyttårsaften',
62
- Date.civil(2010,2,14) => 'Fastelavn',
63
- Date.civil(2010,3,28) => 'Palmesøndag',
64
- Date.civil(2010,4,1) => 'Skjærtorsdag',
65
- Date.civil(2010,4,2) => 'Langfredag',
66
- Date.civil(2010,4,4) => '1. påskedag',
67
- Date.civil(2010,4,5) => '2. påskedag',
68
- Date.civil(2010,5,13) => 'Kristi Himmelfartsdag',
69
- Date.civil(2010,5,23) => '1. pinsedag',
70
- Date.civil(2010,5,24) => '2. pinsedag'}.each do |date, name|
71
- assert_equal name, (Holidays.on(date, :no, :informal)[0] || {})[:name]
72
- end
73
-
74
-
75
- {Date.civil(2008,1,1) => 'Nyårsdagen',
76
- Date.civil(2008,1,6) => 'Trettondedag jul',
77
- Date.civil(2008,3,21) => 'Långfredagen',
78
- Date.civil(2008,3,22) => 'Påskafton',
79
- Date.civil(2008,3,23) => 'Påskdagen',
80
- Date.civil(2008,3,24) => 'Annandag påsk',
81
- Date.civil(2008,5,1) => 'Första maj',
82
- Date.civil(2008,5,1) => 'Kristi himmelsfärdsdag',
83
- Date.civil(2008,5,11) => 'Pingstdagen',
84
- Date.civil(2008,6,6) => 'Nationaldagen',
85
- Date.civil(2005,6,25) => 'Midsommardagen',
86
- Date.civil(2006,6,24) => 'Midsommardagen',
87
- Date.civil(2006,6,23) => 'Midsommarafton',
88
- Date.civil(2007,6,23) => 'Midsommardagen',
89
- Date.civil(2007,6,22) => 'Midsommarafton',
90
- Date.civil(2008,6,21) => 'Midsommardagen',
91
- Date.civil(2008,6,20) => 'Midsommarafton',
92
- Date.civil(2005,11,5) => 'Alla helgons dag',
93
- Date.civil(2006,11,4) => 'Alla helgons dag',
94
- Date.civil(2007,11,3) => 'Alla helgons dag',
95
- Date.civil(2008,11,1) => 'Alla helgons dag',
96
- Date.civil(2008,12,24) => 'Julafton',
97
- Date.civil(2008,12,25) => 'Juldagen',
98
- Date.civil(2008,12,26) => 'Annandag jul',
99
- Date.civil(2008,12,31) => 'Nyårsafton'
100
- }.each do |date, name|
101
- assert_equal name, (Holidays.on(date, :se, :informal)[0] || {})[:name]
102
- end
18
+ assert_equal "Skærtorsdag", (Holidays.on(Date.civil(2007, 4, 5), [:dk], [:informal])[0] || {})[:name]
103
19
 
20
+ assert_equal "Langfredag", (Holidays.on(Date.civil(2007, 4, 6), [:dk], [:informal])[0] || {})[:name]
104
21
 
105
- {Date.civil(2008,1,1) => 'Uudenvuodenpäivä',
106
- Date.civil(2008,1,6) => 'Loppiainen',
107
- Date.civil(2008,3,21) => 'Pitkäperjantai',
108
- Date.civil(2008,3,23) => 'Pääsiäispäivä',
109
- Date.civil(2008,3,24) => '2. Pääsiäispäivä',
110
- Date.civil(2008,5,1) => 'Vappu',
111
- Date.civil(2008,5,1) => 'Helatorstai',
112
- Date.civil(2008,5,11) => 'Helluntaipäivä',
113
- Date.civil(2009,6,19) => 'Juhannusaatto',
114
- Date.civil(2010,6,25) => 'Juhannusaatto',
115
- Date.civil(2011,6,24) => 'Juhannusaatto',
116
- Date.civil(2012,6,22) => 'Juhannusaatto',
117
- Date.civil(2013,6,21) => 'Juhannusaatto',
118
- Date.civil(2005,6,25) => 'Juhannuspäivä',
119
- Date.civil(2006,6,24) => 'Juhannuspäivä',
120
- Date.civil(2007,6,23) => 'Juhannuspäivä',
121
- Date.civil(2008,6,21) => 'Juhannuspäivä',
122
- Date.civil(2005,11,5) => 'Pyhäinpäivä',
123
- Date.civil(2006,11,4) => 'Pyhäinpäivä',
124
- Date.civil(2007,11,3) => 'Pyhäinpäivä',
125
- Date.civil(2008,11,1) => 'Pyhäinpäivä',
126
- Date.civil(2008,12,6) => 'Itsenäisyyspäivä',
127
- Date.civil(2008,12,24) => 'Jouluaatto',
128
- Date.civil(2008,12,25) => 'Joulupäivä',
129
- Date.civil(2008,12,26) => 'Tapaninpäivä'}.each do |date, name|
130
- assert_equal name, (Holidays.on(date, :fi, :informal)[0] || {})[:name]
131
- end
22
+ assert_equal "Påskedag", (Holidays.on(Date.civil(2007, 4, 8), [:dk], [:informal])[0] || {})[:name]
23
+
24
+ assert_equal "Arbejdernes kampdag", (Holidays.on(Date.civil(2007, 5, 1), [:dk], [:informal])[0] || {})[:name]
25
+
26
+ assert_equal "Store Bededag", (Holidays.on(Date.civil(2007, 5, 4), [:dk], [:informal])[0] || {})[:name]
27
+
28
+ assert_equal "Kristi Himmelfartsdag", (Holidays.on(Date.civil(2007, 5, 17), [:dk], [:informal])[0] || {})[:name]
29
+
30
+ assert_equal "Pinsedag", (Holidays.on(Date.civil(2007, 5, 27), [:dk], [:informal])[0] || {})[:name]
31
+
32
+ assert_equal "2. Pinsedag", (Holidays.on(Date.civil(2007, 5, 28), [:dk], [:informal])[0] || {})[:name]
33
+
34
+ assert_equal "Grundlovsdag", (Holidays.on(Date.civil(2007, 6, 5), [:dk], [:informal])[0] || {})[:name]
35
+
36
+ assert_equal "Juleaftensdag", (Holidays.on(Date.civil(2007, 12, 24), [:dk], [:informal])[0] || {})[:name]
37
+
38
+ assert_equal "1. juledag", (Holidays.on(Date.civil(2007, 12, 25), [:dk], [:informal])[0] || {})[:name]
39
+
40
+ assert_equal "2. juledag", (Holidays.on(Date.civil(2007, 12, 26), [:dk], [:informal])[0] || {})[:name]
41
+
42
+ assert_equal "Nýársdagur", (Holidays.on(Date.civil(2007, 1, 1), [:is], [:informal])[0] || {})[:name]
43
+
44
+ assert_equal "Þrettándinn", (Holidays.on(Date.civil(2007, 1, 6), [:is], [:informal])[0] || {})[:name]
45
+
46
+ assert_equal "Bóndadagur", (Holidays.on(Date.civil(2007, 1, 19), [:is], [:informal])[0] || {})[:name]
47
+
48
+ assert_equal "Konudagur", (Holidays.on(Date.civil(2007, 2, 18), [:is], [:informal])[0] || {})[:name]
49
+
50
+ assert_equal "Skírdagur", (Holidays.on(Date.civil(2007, 4, 5), [:is], [:informal])[0] || {})[:name]
51
+
52
+ assert_equal "Föstudaginn langi", (Holidays.on(Date.civil(2007, 4, 6), [:is], [:informal])[0] || {})[:name]
53
+
54
+ assert_equal "Páskadagur", (Holidays.on(Date.civil(2007, 4, 8), [:is], [:informal])[0] || {})[:name]
55
+
56
+ assert_equal "Annar í páskum", (Holidays.on(Date.civil(2007, 4, 9), [:is], [:informal])[0] || {})[:name]
57
+
58
+ assert_equal "Sumardagurinn fyrsti", (Holidays.on(Date.civil(2007, 4, 19), [:is], [:informal])[0] || {})[:name]
59
+
60
+ assert_equal "Verkalýðsdagurinn", (Holidays.on(Date.civil(2007, 5, 1), [:is], [:informal])[0] || {})[:name]
61
+
62
+ assert_equal "Uppstigningardagur", (Holidays.on(Date.civil(2007, 5, 17), [:is], [:informal])[0] || {})[:name]
63
+
64
+ assert_equal "Hvítasunnudagur", (Holidays.on(Date.civil(2007, 5, 27), [:is], [:informal])[0] || {})[:name]
65
+
66
+ assert_equal "Annar í hvítasunnu", (Holidays.on(Date.civil(2007, 5, 28), [:is], [:informal])[0] || {})[:name]
67
+
68
+ assert_equal "Sjómannadagurinn", (Holidays.on(Date.civil(2007, 6, 3), [:is], [:informal])[0] || {})[:name]
69
+
70
+ assert_equal "Lýðveldisdagurinn", (Holidays.on(Date.civil(2007, 6, 17), [:is], [:informal])[0] || {})[:name]
71
+
72
+ assert_equal "Frídagur verslunarmanna", (Holidays.on(Date.civil(2007, 8, 6), [:is], [:informal])[0] || {})[:name]
73
+
74
+ assert_equal "Jól", (Holidays.on(Date.civil(2007, 12, 24), [:is], [:informal])[0] || {})[:name]
75
+
76
+ assert_equal "Jól", (Holidays.on(Date.civil(2007, 12, 25), [:is], [:informal])[0] || {})[:name]
77
+
78
+ assert_equal "Jól", (Holidays.on(Date.civil(2007, 12, 26), [:is], [:informal])[0] || {})[:name]
79
+
80
+ assert_equal "Gamlárskvöld", (Holidays.on(Date.civil(2007, 12, 31), [:is], [:informal])[0] || {})[:name]
81
+
82
+ assert_equal "Nyttårsdag", (Holidays.on(Date.civil(2010, 1, 1), [:no], [:informal])[0] || {})[:name]
83
+
84
+ assert_equal "1. mai", (Holidays.on(Date.civil(2010, 5, 1), [:no], [:informal])[0] || {})[:name]
85
+
86
+ assert_equal "17. mai", (Holidays.on(Date.civil(2010, 5, 17), [:no], [:informal])[0] || {})[:name]
87
+
88
+ assert_equal "Julaften", (Holidays.on(Date.civil(2010, 12, 24), [:no], [:informal])[0] || {})[:name]
89
+
90
+ assert_equal "1. juledag", (Holidays.on(Date.civil(2010, 12, 25), [:no], [:informal])[0] || {})[:name]
91
+
92
+ assert_equal "2. juledag", (Holidays.on(Date.civil(2010, 12, 26), [:no], [:informal])[0] || {})[:name]
93
+
94
+ assert_equal "Nyttårsaften", (Holidays.on(Date.civil(2010, 12, 31), [:no], [:informal])[0] || {})[:name]
95
+
96
+ assert_equal "Fastelavn", (Holidays.on(Date.civil(2010, 2, 14), [:no], [:informal])[0] || {})[:name]
97
+
98
+ assert_equal "Palmesøndag", (Holidays.on(Date.civil(2010, 3, 28), [:no], [:informal])[0] || {})[:name]
99
+
100
+ assert_equal "Skjærtorsdag", (Holidays.on(Date.civil(2010, 4, 1), [:no], [:informal])[0] || {})[:name]
101
+
102
+ assert_equal "Langfredag", (Holidays.on(Date.civil(2010, 4, 2), [:no], [:informal])[0] || {})[:name]
103
+
104
+ assert_equal "1. påskedag", (Holidays.on(Date.civil(2010, 4, 4), [:no], [:informal])[0] || {})[:name]
105
+
106
+ assert_equal "2. påskedag", (Holidays.on(Date.civil(2010, 4, 5), [:no], [:informal])[0] || {})[:name]
107
+
108
+ assert_equal "Kristi Himmelfartsdag", (Holidays.on(Date.civil(2010, 5, 13), [:no], [:informal])[0] || {})[:name]
109
+
110
+ assert_equal "1. pinsedag", (Holidays.on(Date.civil(2010, 5, 23), [:no], [:informal])[0] || {})[:name]
111
+
112
+ assert_equal "2. pinsedag", (Holidays.on(Date.civil(2010, 5, 24), [:no], [:informal])[0] || {})[:name]
113
+
114
+ assert_equal "Nyårsdagen", (Holidays.on(Date.civil(2008, 1, 1), [:se], [:informal])[0] || {})[:name]
115
+
116
+ assert_equal "Trettondedag jul", (Holidays.on(Date.civil(2008, 1, 6), [:se], [:informal])[0] || {})[:name]
117
+
118
+ assert_equal "Långfredagen", (Holidays.on(Date.civil(2008, 3, 21), [:se], [:informal])[0] || {})[:name]
119
+
120
+ assert_equal "Påskafton", (Holidays.on(Date.civil(2008, 3, 22), [:se], [:informal])[0] || {})[:name]
121
+
122
+ assert_equal "Påskdagen", (Holidays.on(Date.civil(2008, 3, 23), [:se], [:informal])[0] || {})[:name]
123
+
124
+ assert_equal "Annandag påsk", (Holidays.on(Date.civil(2008, 3, 24), [:se], [:informal])[0] || {})[:name]
125
+
126
+ assert_equal "Kristi himmelsfärdsdag", (Holidays.on(Date.civil(2008, 5, 1), [:se], [:informal])[0] || {})[:name]
127
+
128
+ assert_equal "Pingstdagen", (Holidays.on(Date.civil(2008, 5, 11), [:se], [:informal])[0] || {})[:name]
129
+
130
+ assert_equal "Nationaldagen", (Holidays.on(Date.civil(2008, 6, 6), [:se], [:informal])[0] || {})[:name]
131
+
132
+ assert_equal "Midsommardagen", (Holidays.on(Date.civil(2005, 6, 25), [:se], [:informal])[0] || {})[:name]
133
+
134
+ assert_equal "Midsommardagen", (Holidays.on(Date.civil(2006, 6, 24), [:se], [:informal])[0] || {})[:name]
135
+
136
+ assert_equal "Midsommarafton", (Holidays.on(Date.civil(2006, 6, 23), [:se], [:informal])[0] || {})[:name]
137
+
138
+ assert_equal "Midsommardagen", (Holidays.on(Date.civil(2007, 6, 23), [:se], [:informal])[0] || {})[:name]
139
+
140
+ assert_equal "Midsommarafton", (Holidays.on(Date.civil(2007, 6, 22), [:se], [:informal])[0] || {})[:name]
141
+
142
+ assert_equal "Midsommardagen", (Holidays.on(Date.civil(2008, 6, 21), [:se], [:informal])[0] || {})[:name]
143
+
144
+ assert_equal "Midsommarafton", (Holidays.on(Date.civil(2008, 6, 20), [:se], [:informal])[0] || {})[:name]
145
+
146
+ assert_equal "Alla helgons dag", (Holidays.on(Date.civil(2005, 11, 5), [:se], [:informal])[0] || {})[:name]
147
+
148
+ assert_equal "Alla helgons dag", (Holidays.on(Date.civil(2006, 11, 4), [:se], [:informal])[0] || {})[:name]
149
+
150
+ assert_equal "Alla helgons dag", (Holidays.on(Date.civil(2007, 11, 3), [:se], [:informal])[0] || {})[:name]
151
+
152
+ assert_equal "Alla helgons dag", (Holidays.on(Date.civil(2008, 11, 1), [:se], [:informal])[0] || {})[:name]
153
+
154
+ assert_equal "Julafton", (Holidays.on(Date.civil(2008, 12, 24), [:se], [:informal])[0] || {})[:name]
155
+
156
+ assert_equal "Juldagen", (Holidays.on(Date.civil(2008, 12, 25), [:se], [:informal])[0] || {})[:name]
157
+
158
+ assert_equal "Annandag jul", (Holidays.on(Date.civil(2008, 12, 26), [:se], [:informal])[0] || {})[:name]
159
+
160
+ assert_equal "Nyårsafton", (Holidays.on(Date.civil(2008, 12, 31), [:se], [:informal])[0] || {})[:name]
161
+
162
+ assert_equal "Uudenvuodenpäivä", (Holidays.on(Date.civil(2008, 1, 1), [:fi], [:informal])[0] || {})[:name]
163
+
164
+ assert_equal "Loppiainen", (Holidays.on(Date.civil(2008, 1, 6), [:fi], [:informal])[0] || {})[:name]
165
+
166
+ assert_equal "Pitkäperjantai", (Holidays.on(Date.civil(2008, 3, 21), [:fi], [:informal])[0] || {})[:name]
167
+
168
+ assert_equal "Pääsiäispäivä", (Holidays.on(Date.civil(2008, 3, 23), [:fi], [:informal])[0] || {})[:name]
169
+
170
+ assert_equal "2. Pääsiäispäivä", (Holidays.on(Date.civil(2008, 3, 24), [:fi], [:informal])[0] || {})[:name]
171
+
172
+ assert_equal "Helatorstai", (Holidays.on(Date.civil(2008, 5, 1), [:fi], [:informal])[0] || {})[:name]
173
+
174
+ assert_equal "Helluntaipäivä", (Holidays.on(Date.civil(2008, 5, 11), [:fi], [:informal])[0] || {})[:name]
175
+
176
+ assert_equal "Juhannusaatto", (Holidays.on(Date.civil(2009, 6, 19), [:fi], [:informal])[0] || {})[:name]
177
+
178
+ assert_equal "Juhannusaatto", (Holidays.on(Date.civil(2010, 6, 25), [:fi], [:informal])[0] || {})[:name]
179
+
180
+ assert_equal "Juhannusaatto", (Holidays.on(Date.civil(2011, 6, 24), [:fi], [:informal])[0] || {})[:name]
181
+
182
+ assert_equal "Juhannusaatto", (Holidays.on(Date.civil(2012, 6, 22), [:fi], [:informal])[0] || {})[:name]
183
+
184
+ assert_equal "Juhannusaatto", (Holidays.on(Date.civil(2013, 6, 21), [:fi], [:informal])[0] || {})[:name]
185
+
186
+ assert_equal "Juhannuspäivä", (Holidays.on(Date.civil(2005, 6, 25), [:fi], [:informal])[0] || {})[:name]
187
+
188
+ assert_equal "Juhannuspäivä", (Holidays.on(Date.civil(2006, 6, 24), [:fi], [:informal])[0] || {})[:name]
189
+
190
+ assert_equal "Juhannuspäivä", (Holidays.on(Date.civil(2007, 6, 23), [:fi], [:informal])[0] || {})[:name]
191
+
192
+ assert_equal "Juhannuspäivä", (Holidays.on(Date.civil(2008, 6, 21), [:fi], [:informal])[0] || {})[:name]
193
+
194
+ assert_equal "Pyhäinpäivä", (Holidays.on(Date.civil(2005, 11, 5), [:fi], [:informal])[0] || {})[:name]
195
+
196
+ assert_equal "Pyhäinpäivä", (Holidays.on(Date.civil(2006, 11, 4), [:fi], [:informal])[0] || {})[:name]
197
+
198
+ assert_equal "Pyhäinpäivä", (Holidays.on(Date.civil(2007, 11, 3), [:fi], [:informal])[0] || {})[:name]
199
+
200
+ assert_equal "Pyhäinpäivä", (Holidays.on(Date.civil(2008, 11, 1), [:fi], [:informal])[0] || {})[:name]
201
+
202
+ assert_equal "Itsenäisyyspäivä", (Holidays.on(Date.civil(2008, 12, 6), [:fi], [:informal])[0] || {})[:name]
203
+
204
+ assert_equal "Jouluaatto", (Holidays.on(Date.civil(2008, 12, 24), [:fi], [:informal])[0] || {})[:name]
205
+
206
+ assert_equal "Joulupäivä", (Holidays.on(Date.civil(2008, 12, 25), [:fi], [:informal])[0] || {})[:name]
207
+
208
+ assert_equal "Tapaninpäivä", (Holidays.on(Date.civil(2008, 12, 26), [:fi], [:informal])[0] || {})[:name]
132
209
 
133
210
  end
134
211
  end