From fa6ad64f81fb8a87ad42f0831039b5598655728d Mon Sep 17 00:00:00 2001 From: Rowan Crawford Date: Wed, 28 Apr 2010 21:13:56 +0800 Subject: [PATCH] Update generate test_defs --- test/defs/test_defs_au.rb | 3 +-- test/defs/test_defs_ca.rb | 3 +-- test/defs/test_defs_cz.rb | 3 +-- test/defs/test_defs_de.rb | 3 +-- test/defs/test_defs_dk.rb | 3 +-- test/defs/test_defs_es.rb | 3 +-- test/defs/test_defs_europe.rb | 25 ++++++++++++------------- test/defs/test_defs_fr.rb | 3 +-- test/defs/test_defs_gb.rb | 3 +-- test/defs/test_defs_ie.rb | 3 +-- test/defs/test_defs_is.rb | 3 +-- test/defs/test_defs_it.rb | 3 +-- test/defs/test_defs_mx.rb | 3 +-- test/defs/test_defs_nl.rb | 3 +-- test/defs/test_defs_no.rb | 3 +-- test/defs/test_defs_north_america.rb | 7 +++---- test/defs/test_defs_nyse.rb | 3 +-- test/defs/test_defs_nz.rb | 3 +-- test/defs/test_defs_pt.rb | 3 +-- test/defs/test_defs_scandinavia.rb | 6 +++--- test/defs/test_defs_se.rb | 2 +- test/defs/test_defs_ups.rb | 3 +-- test/defs/test_defs_us.rb | 3 +-- test/defs/test_defs_za.rb | 3 +-- 24 files changed, 39 insertions(+), 61 deletions(-) diff --git a/test/defs/test_defs_au.rb b/test/defs/test_defs_au.rb index a9af891..d9204d8 100644 --- a/test/defs/test_defs_au.rb +++ b/test/defs/test_defs_au.rb @@ -1,5 +1,4 @@ require File.dirname(__FILE__) + '/../test_helper' -require 'holidays/au' # This file is generated by the Ruby Holiday gem. # @@ -14,7 +13,7 @@ class AuDefinitionTests < Test::Unit::TestCase # :nodoc: Date.civil(2007,4,25) => 'ANZAC Day', Date.civil(2007,12,25) => 'Christmas Day', Date.civil(2007,12,26) => 'Boxing Day'}.each do |date, name| - assert_equal name, Holidays.on(date, :au, :informal)[0][:name] + assert_equal name, (Holidays.on(date, :au, :informal)[0] || {})[:name] end [:au_sa, :au_act, :au_nsw, :au_].each do |r| diff --git a/test/defs/test_defs_ca.rb b/test/defs/test_defs_ca.rb index 664c107..13d6d23 100644 --- a/test/defs/test_defs_ca.rb +++ b/test/defs/test_defs_ca.rb @@ -1,5 +1,4 @@ require File.dirname(__FILE__) + '/../test_helper' -require 'holidays/ca' # This file is generated by the Ruby Holiday gem. # @@ -17,7 +16,7 @@ class CaDefinitionTests < Test::Unit::TestCase # :nodoc: Date.civil(2008,11,11) => 'Rememberance Day', Date.civil(2008,12,25) => 'Christmas Day', Date.civil(2008,12,26) => 'Boxing Day'}.each do |date, name| - assert_equal name, Holidays.on(date, :ca, :informal)[0][:name] + assert_equal name, (Holidays.on(date, :ca, :informal)[0] || {})[:name] end # Victoria Day diff --git a/test/defs/test_defs_cz.rb b/test/defs/test_defs_cz.rb index 60310a3..2a05b57 100644 --- a/test/defs/test_defs_cz.rb +++ b/test/defs/test_defs_cz.rb @@ -1,5 +1,4 @@ require File.dirname(__FILE__) + '/../test_helper' -require 'holidays/cz' # This file is generated by the Ruby Holiday gem. # @@ -19,7 +18,7 @@ class CzDefinitionTests < Test::Unit::TestCase # :nodoc: Date.civil(2010,12,24) => 'Štědrý den', Date.civil(2010,12,25) => '1. svátek vánoční', Date.civil(2010,12,26) => '2. svátek vánoční'}.each do |date, name| - assert_equal name, Holidays.on(date, :cz, :informal)[0][:name] + assert_equal name, (Holidays.on(date, :cz, :informal)[0] || {})[:name] end end diff --git a/test/defs/test_defs_de.rb b/test/defs/test_defs_de.rb index e3bc159..991e659 100644 --- a/test/defs/test_defs_de.rb +++ b/test/defs/test_defs_de.rb @@ -1,5 +1,4 @@ require File.dirname(__FILE__) + '/../test_helper' -require 'holidays/de' # This file is generated by the Ruby Holiday gem. # @@ -16,7 +15,7 @@ class DeDefinitionTests < Test::Unit::TestCase # :nodoc: Date.civil(2009,10,3) => 'Tag der Deutschen Einheit', Date.civil(2009,12,25) => '1. Weihnachtstag', Date.civil(2009,12,26) => '2. Weihnachtstag'}.each do |date, name| - assert_equal name, Holidays.on(date, :de, :informal)[0][:name] + assert_equal name, (Holidays.on(date, :de, :informal)[0] || {})[:name] end [:de_bw, :de_by, :de_st, :de_].each do |r| diff --git a/test/defs/test_defs_dk.rb b/test/defs/test_defs_dk.rb index 5515006..8b105bd 100644 --- a/test/defs/test_defs_dk.rb +++ b/test/defs/test_defs_dk.rb @@ -1,5 +1,4 @@ require File.dirname(__FILE__) + '/../test_helper' -require 'holidays/dk' # This file is generated by the Ruby Holiday gem. # @@ -24,7 +23,7 @@ class DkDefinitionTests < Test::Unit::TestCase # :nodoc: Date.civil(2007,12,24) => 'Juleaftensdag', Date.civil(2007,12,25) => '1. juledag', Date.civil(2007,12,26) => '2. juledag'}.each do |date, name| - assert_equal name, Holidays.on(date, :dk, :informal)[0][:name] + assert_equal name, (Holidays.on(date, :dk, :informal)[0] || {})[:name] end end end diff --git a/test/defs/test_defs_es.rb b/test/defs/test_defs_es.rb index 24c2185..75924cb 100644 --- a/test/defs/test_defs_es.rb +++ b/test/defs/test_defs_es.rb @@ -1,5 +1,4 @@ require File.dirname(__FILE__) + '/../test_helper' -require 'holidays/es' # This file is generated by the Ruby Holiday gem. # @@ -17,7 +16,7 @@ class EsDefinitionTests < Test::Unit::TestCase # :nodoc: Date.civil(2009,12,6) => 'Día de la Constitución', Date.civil(2009,12,8) => 'Inmaculada Concepción', Date.civil(2009,12,25) => 'Navidad del Señor'}.each do |date, name| - assert_equal name, Holidays.on(date, :es, :informal)[0][:name] + assert_equal name, (Holidays.on(date, :es, :informal)[0] || {})[:name] end [:es_pv, :es_ct, :es_na, :es_v, :es_vc, :es_].each do |r| diff --git a/test/defs/test_defs_europe.rb b/test/defs/test_defs_europe.rb index 838da90..87ab5f0 100644 --- a/test/defs/test_defs_europe.rb +++ b/test/defs/test_defs_europe.rb @@ -1,5 +1,4 @@ require File.dirname(__FILE__) + '/../test_helper' -require 'holidays/europe' # This file is generated by the Ruby Holiday gem. # @@ -19,7 +18,7 @@ class EuropeDefinitionTests < Test::Unit::TestCase # :nodoc: Date.civil(2010,12,24) => 'Štědrý den', Date.civil(2010,12,25) => '1. svátek vánoční', Date.civil(2010,12,26) => '2. svátek vánoční'}.each do |date, name| - assert_equal name, Holidays.on(date, :cz, :informal)[0][:name] + assert_equal name, (Holidays.on(date, :cz, :informal)[0] || {})[:name] end @@ -40,7 +39,7 @@ end Date.civil(2007,12,24) => 'Juleaftensdag', Date.civil(2007,12,25) => '1. juledag', Date.civil(2007,12,26) => '2. juledag'}.each do |date, name| - assert_equal name, Holidays.on(date, :dk, :informal)[0][:name] + assert_equal name, (Holidays.on(date, :dk, :informal)[0] || {})[:name] end {Date.civil(2009,1,1) => 'Neujahrstag', @@ -52,7 +51,7 @@ end Date.civil(2009,10,3) => 'Tag der Deutschen Einheit', Date.civil(2009,12,25) => '1. Weihnachtstag', Date.civil(2009,12,26) => '2. Weihnachtstag'}.each do |date, name| - assert_equal name, Holidays.on(date, :de, :informal)[0][:name] + assert_equal name, (Holidays.on(date, :de, :informal)[0] || {})[:name] end [:de_bw, :de_by, :de_st, :de_].each do |r| @@ -92,7 +91,7 @@ assert_equal 'Buß- und Bettag', Date.civil(2009,11,18).holidays(:de_sn)[0][:nam Date.civil(2009,12,6) => 'Día de la Constitución', Date.civil(2009,12,8) => 'Inmaculada Concepción', Date.civil(2009,12,25) => 'Navidad del Señor'}.each do |date, name| - assert_equal name, Holidays.on(date, :es, :informal)[0][:name] + assert_equal name, (Holidays.on(date, :es, :informal)[0] || {})[:name] end [:es_pv, :es_ct, :es_na, :es_v, :es_vc, :es_].each do |r| @@ -142,7 +141,7 @@ assert_equal 'Fiesta Nacional de Cataluña', Date.civil(2009,9,11).holidays(:es_ Date.civil(2007,11,1) => 'Toussaint', Date.civil(2007,11,11) => 'Armistice 1918', Date.civil(2007,12,25) => 'Nöel'}.each do |date, name| - assert_equal name, Holidays.on(date, :fr, :informal)[0][:name] + assert_equal name, (Holidays.on(date, :fr, :informal)[0] || {})[:name] end {Date.civil(2008,1,1) => 'New Year\'s Day', @@ -153,7 +152,7 @@ end Date.civil(2008,11,5) => 'Guy Fawkes Day', Date.civil(2008,12,25) => 'Christmas Day', Date.civil(2008,12,26) => 'Boxing Day'}.each do |date, name| - assert_equal name, Holidays.on(date, :gb, :informal)[0][:name] + assert_equal name, (Holidays.on(date, :gb, :informal)[0] || {})[:name] end assert_equal 'St. Patrick\'s Day', Date.civil(2008,3,17).holidays(:gb_nir, :informal)[0][:name] @@ -179,7 +178,7 @@ end Date.civil(2008,8,4) => 'Bank Holiday', Date.civil(2008,12,25) => 'Christmas Day', Date.civil(2008,12,26) => 'St. Stephen\'s Day'}.each do |date, name| - assert_equal name, Holidays.on(date, :ie, :informal)[0][:name] + assert_equal name, (Holidays.on(date, :ie, :informal)[0] || {})[:name] end {Date.civil(2007,1,1) => 'Nýársdagur', @@ -202,7 +201,7 @@ end Date.civil(2007,12,25) => 'Jól', Date.civil(2007,12,26) => 'Jól', Date.civil(2007,12,31) => 'Gamlárskvöld'}.each do |date, name| - assert_equal name, Holidays.on(date, :is, :informal)[0][:name] + assert_equal name, (Holidays.on(date, :is, :informal)[0] || {})[:name] end {Date.civil(2007,1,1) => 'Capodanno', @@ -217,7 +216,7 @@ end Date.civil(2007,12,8) => 'Immacolata Concezione', Date.civil(2007,12,25) => 'Natale', Date.civil(2007,12,26) => 'Santo Stefano'}.each do |date, name| - assert_equal name, Holidays.on(date, :it, :informal)[0][:name] + assert_equal name, (Holidays.on(date, :it, :informal)[0] || {})[:name] end {Date.civil(2008,1,1) => 'Nieuwjaar', @@ -231,7 +230,7 @@ end Date.civil(2008,5,12) => 'Pinksteren', # Pentecost, Easter+50 Date.civil(2008,12,25) => 'Kerstmis', Date.civil(2008,12,26) => 'Kerstmis'}.each do |date, name| - assert_equal name, Holidays.on(date, :nl, :informal)[0][:name] + assert_equal name, (Holidays.on(date, :nl, :informal)[0] || {})[:name] end {Date.civil(2010,1,1) => 'Nyttårsdag', @@ -250,7 +249,7 @@ end Date.civil(2010,5,13) => 'Kristi Himmelfartsdag', Date.civil(2010,5,23) => '1. pinsedag', Date.civil(2010,5,24) => '2. pinsedag'}.each do |date, name| - assert_equal name, Holidays.on(date, :no, :informal)[0][:name] + assert_equal name, (Holidays.on(date, :no, :informal)[0] || {})[:name] end {Date.civil(2008,1,1) => 'Ano Novo', @@ -272,7 +271,7 @@ end Date.civil(2008,12,1) => 'Restauração da Independência', Date.civil(2008,12,8) => 'Imaculada Conceição', Date.civil(2008,12,25) => 'Natal'}.each do |date, name| - assert_equal name, Holidays.on(date, :pt, :informal)[0][:name] + assert_equal name, (Holidays.on(date, :pt, :informal)[0] || {})[:name] end end end diff --git a/test/defs/test_defs_fr.rb b/test/defs/test_defs_fr.rb index a3ca364..18d3cab 100644 --- a/test/defs/test_defs_fr.rb +++ b/test/defs/test_defs_fr.rb @@ -1,5 +1,4 @@ require File.dirname(__FILE__) + '/../test_helper' -require 'holidays/fr' # This file is generated by the Ruby Holiday gem. # @@ -20,7 +19,7 @@ class FrDefinitionTests < Test::Unit::TestCase # :nodoc: Date.civil(2007,11,1) => 'Toussaint', Date.civil(2007,11,11) => 'Armistice 1918', Date.civil(2007,12,25) => 'Nöel'}.each do |date, name| - assert_equal name, Holidays.on(date, :fr, :informal)[0][:name] + assert_equal name, (Holidays.on(date, :fr, :informal)[0] || {})[:name] end end end diff --git a/test/defs/test_defs_gb.rb b/test/defs/test_defs_gb.rb index 565a2c9..b51ae95 100644 --- a/test/defs/test_defs_gb.rb +++ b/test/defs/test_defs_gb.rb @@ -1,5 +1,4 @@ require File.dirname(__FILE__) + '/../test_helper' -require 'holidays/gb' # This file is generated by the Ruby Holiday gem. # @@ -15,7 +14,7 @@ class GbDefinitionTests < Test::Unit::TestCase # :nodoc: Date.civil(2008,11,5) => 'Guy Fawkes Day', Date.civil(2008,12,25) => 'Christmas Day', Date.civil(2008,12,26) => 'Boxing Day'}.each do |date, name| - assert_equal name, Holidays.on(date, :gb, :informal)[0][:name] + assert_equal name, (Holidays.on(date, :gb, :informal)[0] || {})[:name] end assert_equal 'St. Patrick\'s Day', Date.civil(2008,3,17).holidays(:gb_nir, :informal)[0][:name] diff --git a/test/defs/test_defs_ie.rb b/test/defs/test_defs_ie.rb index 5391547..ceecba1 100644 --- a/test/defs/test_defs_ie.rb +++ b/test/defs/test_defs_ie.rb @@ -1,5 +1,4 @@ require File.dirname(__FILE__) + '/../test_helper' -require 'holidays/ie' # This file is generated by the Ruby Holiday gem. # @@ -15,7 +14,7 @@ class IeDefinitionTests < Test::Unit::TestCase # :nodoc: Date.civil(2008,8,4) => 'Bank Holiday', Date.civil(2008,12,25) => 'Christmas Day', Date.civil(2008,12,26) => 'St. Stephen\'s Day'}.each do |date, name| - assert_equal name, Holidays.on(date, :ie, :informal)[0][:name] + assert_equal name, (Holidays.on(date, :ie, :informal)[0] || {})[:name] end end end diff --git a/test/defs/test_defs_is.rb b/test/defs/test_defs_is.rb index a3ee66f..cc679b2 100644 --- a/test/defs/test_defs_is.rb +++ b/test/defs/test_defs_is.rb @@ -1,5 +1,4 @@ require File.dirname(__FILE__) + '/../test_helper' -require 'holidays/is' # This file is generated by the Ruby Holiday gem. # @@ -27,7 +26,7 @@ class IsDefinitionTests < Test::Unit::TestCase # :nodoc: Date.civil(2007,12,25) => 'Jól', Date.civil(2007,12,26) => 'Jól', Date.civil(2007,12,31) => 'Gamlárskvöld'}.each do |date, name| - assert_equal name, Holidays.on(date, :is, :informal)[0][:name] + assert_equal name, (Holidays.on(date, :is, :informal)[0] || {})[:name] end end end diff --git a/test/defs/test_defs_it.rb b/test/defs/test_defs_it.rb index 49a6b26..4669829 100644 --- a/test/defs/test_defs_it.rb +++ b/test/defs/test_defs_it.rb @@ -1,5 +1,4 @@ require File.dirname(__FILE__) + '/../test_helper' -require 'holidays/it' # This file is generated by the Ruby Holiday gem. # @@ -19,7 +18,7 @@ class ItDefinitionTests < Test::Unit::TestCase # :nodoc: Date.civil(2007,12,8) => 'Immacolata Concezione', Date.civil(2007,12,25) => 'Natale', Date.civil(2007,12,26) => 'Santo Stefano'}.each do |date, name| - assert_equal name, Holidays.on(date, :it, :informal)[0][:name] + assert_equal name, (Holidays.on(date, :it, :informal)[0] || {})[:name] end end end diff --git a/test/defs/test_defs_mx.rb b/test/defs/test_defs_mx.rb index d3eef11..dca3f25 100644 --- a/test/defs/test_defs_mx.rb +++ b/test/defs/test_defs_mx.rb @@ -1,5 +1,4 @@ require File.dirname(__FILE__) + '/../test_helper' -require 'holidays/mx' # This file is generated by the Ruby Holiday gem. # @@ -16,7 +15,7 @@ class MxDefinitionTests < Test::Unit::TestCase # :nodoc: Date.civil(2007,11,2) => 'Los Fieles Difuntos', Date.civil(2007,11,19) => 'Día de la Revolución', Date.civil(2007,12,25) => 'Navidad'}.each do |date, name| - assert_equal name, Holidays.on(date, :mx, :informal)[0][:name] + assert_equal name, (Holidays.on(date, :mx, :informal)[0] || {})[:name] end end end diff --git a/test/defs/test_defs_nl.rb b/test/defs/test_defs_nl.rb index 67aaabe..ed59bc6 100644 --- a/test/defs/test_defs_nl.rb +++ b/test/defs/test_defs_nl.rb @@ -1,5 +1,4 @@ require File.dirname(__FILE__) + '/../test_helper' -require 'holidays/nl' # This file is generated by the Ruby Holiday gem. # @@ -18,7 +17,7 @@ class NlDefinitionTests < Test::Unit::TestCase # :nodoc: Date.civil(2008,5,12) => 'Pinksteren', # Pentecost, Easter+50 Date.civil(2008,12,25) => 'Kerstmis', Date.civil(2008,12,26) => 'Kerstmis'}.each do |date, name| - assert_equal name, Holidays.on(date, :nl, :informal)[0][:name] + assert_equal name, (Holidays.on(date, :nl, :informal)[0] || {})[:name] end end end diff --git a/test/defs/test_defs_no.rb b/test/defs/test_defs_no.rb index 75d9051..fcd703c 100644 --- a/test/defs/test_defs_no.rb +++ b/test/defs/test_defs_no.rb @@ -1,5 +1,4 @@ require File.dirname(__FILE__) + '/../test_helper' -require 'holidays/no' # This file is generated by the Ruby Holiday gem. # @@ -23,7 +22,7 @@ class NoDefinitionTests < Test::Unit::TestCase # :nodoc: Date.civil(2010,5,13) => 'Kristi Himmelfartsdag', Date.civil(2010,5,23) => '1. pinsedag', Date.civil(2010,5,24) => '2. pinsedag'}.each do |date, name| - assert_equal name, Holidays.on(date, :no, :informal)[0][:name] + assert_equal name, (Holidays.on(date, :no, :informal)[0] || {})[:name] end end end diff --git a/test/defs/test_defs_north_america.rb b/test/defs/test_defs_north_america.rb index 508189d..6ddea0e 100644 --- a/test/defs/test_defs_north_america.rb +++ b/test/defs/test_defs_north_america.rb @@ -1,5 +1,4 @@ require File.dirname(__FILE__) + '/../test_helper' -require 'holidays/north_america' # This file is generated by the Ruby Holiday gem. # @@ -17,7 +16,7 @@ class North_americaDefinitionTests < Test::Unit::TestCase # :nodoc: Date.civil(2008,11,11) => 'Rememberance Day', Date.civil(2008,12,25) => 'Christmas Day', Date.civil(2008,12,26) => 'Boxing Day'}.each do |date, name| - assert_equal name, Holidays.on(date, :ca, :informal)[0][:name] + assert_equal name, (Holidays.on(date, :ca, :informal)[0] || {})[:name] end # Victoria Day @@ -35,7 +34,7 @@ end Date.civil(2007,11,2) => 'Los Fieles Difuntos', Date.civil(2007,11,19) => 'Día de la Revolución', Date.civil(2007,12,25) => 'Navidad'}.each do |date, name| - assert_equal name, Holidays.on(date, :mx, :informal)[0][:name] + assert_equal name, (Holidays.on(date, :mx, :informal)[0] || {})[:name] end {Date.civil(2008,1,1) => 'New Year\'s Day', @@ -48,7 +47,7 @@ end Date.civil(2008,11,11) => 'Veterans Day', Date.civil(2008,11,27) => 'Thanksgiving', Date.civil(2008,12,25) => 'Christmas Day'}.each do |date, name| - assert_equal name, Holidays.on(date, :us)[0][:name] + assert_equal name, (Holidays.on(date, :us)[0] || {})[:name] end end end diff --git a/test/defs/test_defs_nyse.rb b/test/defs/test_defs_nyse.rb index 76cf37f..0f01446 100644 --- a/test/defs/test_defs_nyse.rb +++ b/test/defs/test_defs_nyse.rb @@ -1,5 +1,4 @@ require File.dirname(__FILE__) + '/../test_helper' -require 'holidays/nyse' # This file is generated by the Ruby Holiday gem. # @@ -16,7 +15,7 @@ class NyseDefinitionTests < Test::Unit::TestCase # :nodoc: Date.civil(2008,9,1) => 'Labor Day', Date.civil(2008,11,27) => 'Thanksgiving', Date.civil(2008,12,25) => 'Christmas Day'}.each do |date, name| - assert_equal name, Holidays.on(date, :nyse)[0][:name] + assert_equal name, (Holidays.on(date, :nyse)[0] || {})[:name] end end end diff --git a/test/defs/test_defs_nz.rb b/test/defs/test_defs_nz.rb index 02b19d7..e8f43d8 100644 --- a/test/defs/test_defs_nz.rb +++ b/test/defs/test_defs_nz.rb @@ -1,5 +1,4 @@ require File.dirname(__FILE__) + '/../test_helper' -require 'holidays/nz' # This file is generated by the Ruby Holiday gem. # @@ -15,7 +14,7 @@ class NzDefinitionTests < Test::Unit::TestCase # :nodoc: Date.civil(2007,4,25) => 'ANZAC Day', Date.civil(2007,12,25) => 'Christmas Day', Date.civil(2007,12,26) => 'Boxing Day'}.each do |date, name| - assert_equal name, Holidays.on(date, :nz, :informal)[0][:name] + assert_equal name, (Holidays.on(date, :nz, :informal)[0] || {})[:name] end end diff --git a/test/defs/test_defs_pt.rb b/test/defs/test_defs_pt.rb index 0a3ee20..7f6a757 100644 --- a/test/defs/test_defs_pt.rb +++ b/test/defs/test_defs_pt.rb @@ -1,5 +1,4 @@ require File.dirname(__FILE__) + '/../test_helper' -require 'holidays/pt' # This file is generated by the Ruby Holiday gem. # @@ -26,7 +25,7 @@ class PtDefinitionTests < Test::Unit::TestCase # :nodoc: Date.civil(2008,12,1) => 'Restauração da Independência', Date.civil(2008,12,8) => 'Imaculada Conceição', Date.civil(2008,12,25) => 'Natal'}.each do |date, name| - assert_equal name, Holidays.on(date, :pt, :informal)[0][:name] + assert_equal name, (Holidays.on(date, :pt, :informal)[0] || {})[:name] end end end diff --git a/test/defs/test_defs_scandinavia.rb b/test/defs/test_defs_scandinavia.rb index 106556a..aa1c6a9 100644 --- a/test/defs/test_defs_scandinavia.rb +++ b/test/defs/test_defs_scandinavia.rb @@ -24,7 +24,7 @@ class ScandinaviaDefinitionTests < Test::Unit::TestCase # :nodoc: Date.civil(2007,12,24) => 'Juleaftensdag', Date.civil(2007,12,25) => '1. juledag', Date.civil(2007,12,26) => '2. juledag'}.each do |date, name| - assert_equal name, Holidays.on(date, :dk, :informal)[0][:name] + assert_equal name, (Holidays.on(date, :dk, :informal)[0] || {})[:name] end {Date.civil(2007,1,1) => 'Nýársdagur', @@ -47,7 +47,7 @@ end Date.civil(2007,12,25) => 'Jól', Date.civil(2007,12,26) => 'Jól', Date.civil(2007,12,31) => 'Gamlárskvöld'}.each do |date, name| - assert_equal name, Holidays.on(date, :is, :informal)[0][:name] + assert_equal name, (Holidays.on(date, :is, :informal)[0] || {})[:name] end {Date.civil(2008,1,1) => 'Nyårsdagen', @@ -69,7 +69,7 @@ end Date.civil(2008,11,1) => 'Alla helgons dag', Date.civil(2008,12,25) => 'Juldagen', Date.civil(2008,12,26) => 'Annandag jul'}.each do |date, name| - assert_equal name, Holidays.on(date, :se, :informal)[0][:name] + assert_equal name, (Holidays.on(date, :se, :informal)[0] || {})[:name] end end end diff --git a/test/defs/test_defs_se.rb b/test/defs/test_defs_se.rb index 6dd005a..901e8c5 100644 --- a/test/defs/test_defs_se.rb +++ b/test/defs/test_defs_se.rb @@ -26,7 +26,7 @@ class SeDefinitionTests < Test::Unit::TestCase # :nodoc: Date.civil(2008,11,1) => 'Alla helgons dag', Date.civil(2008,12,25) => 'Juldagen', Date.civil(2008,12,26) => 'Annandag jul'}.each do |date, name| - assert_equal name, Holidays.on(date, :se, :informal)[0][:name] + assert_equal name, (Holidays.on(date, :se, :informal)[0] || {})[:name] end end end diff --git a/test/defs/test_defs_ups.rb b/test/defs/test_defs_ups.rb index c77390c..b4daf8b 100644 --- a/test/defs/test_defs_ups.rb +++ b/test/defs/test_defs_ups.rb @@ -1,5 +1,4 @@ require File.dirname(__FILE__) + '/../test_helper' -require 'holidays/ups' # This file is generated by the Ruby Holiday gem. # @@ -15,7 +14,7 @@ class UpsDefinitionTests < Test::Unit::TestCase # :nodoc: Date.civil(2008,11,28) => 'Day After Thanksgiving', Date.civil(2008,12,25) => 'Christmas Day', Date.civil(2008,12,31) => 'New Year\'s Eve',}.each do |date, name| - assert_equal name, Holidays.on(date, :ups)[0][:name] + assert_equal name, (Holidays.on(date, :ups)[0] || {})[:name] end end end diff --git a/test/defs/test_defs_us.rb b/test/defs/test_defs_us.rb index 0c4b527..c199f08 100644 --- a/test/defs/test_defs_us.rb +++ b/test/defs/test_defs_us.rb @@ -1,5 +1,4 @@ require File.dirname(__FILE__) + '/../test_helper' -require 'holidays/us' # This file is generated by the Ruby Holiday gem. # @@ -17,7 +16,7 @@ class UsDefinitionTests < Test::Unit::TestCase # :nodoc: Date.civil(2008,11,11) => 'Veterans Day', Date.civil(2008,11,27) => 'Thanksgiving', Date.civil(2008,12,25) => 'Christmas Day'}.each do |date, name| - assert_equal name, Holidays.on(date, :us)[0][:name] + assert_equal name, (Holidays.on(date, :us)[0] || {})[:name] end end end diff --git a/test/defs/test_defs_za.rb b/test/defs/test_defs_za.rb index db9f476..ecaf398 100644 --- a/test/defs/test_defs_za.rb +++ b/test/defs/test_defs_za.rb @@ -1,5 +1,4 @@ require File.dirname(__FILE__) + '/../test_helper' -require 'holidays/za' # This file is generated by the Ruby Holiday gem. # @@ -19,7 +18,7 @@ class ZaDefinitionTests < Test::Unit::TestCase # :nodoc: Date.civil(2007,12,16) => 'Day of Reconciliation', Date.civil(2007,12,25) => 'Christmas Day', Date.civil(2007,12,26) => 'Day of Goodwill'}.each do |date, name| - assert_equal name, Holidays.on(date, :za, :informal)[0][:name] + assert_equal name, (Holidays.on(date, :za, :informal)[0] || {})[:name] end end end