Update tests to give more useful information when they fail.
This commit is contained in:
parent
608f677039
commit
642c53319f
22 changed files with 22 additions and 22 deletions
|
@ -101,7 +101,7 @@ All definition files should have tests included. In the YAML file, tests are ju
|
|||
Date.civil(2008,9,1) => 'Labour 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
|
||||
|
|
|
@ -91,7 +91,7 @@ tests: |
|
|||
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|
|
||||
|
|
|
@ -131,7 +131,7 @@ tests: |
|
|||
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
|
||||
|
|
|
@ -63,6 +63,6 @@ tests: |
|
|||
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
|
||||
|
||||
|
|
|
@ -81,7 +81,7 @@ tests: |
|
|||
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|
|
||||
|
|
|
@ -113,5 +113,5 @@ tests: |
|
|||
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
|
|
@ -123,7 +123,7 @@ tests: |
|
|||
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|
|
||||
|
|
|
@ -66,5 +66,5 @@ tests: |
|
|||
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
|
|
@ -87,7 +87,7 @@ tests: |
|
|||
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]
|
||||
|
|
|
@ -54,5 +54,5 @@ tests: |
|
|||
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
|
|
@ -132,5 +132,5 @@ tests: |
|
|||
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
|
|
@ -62,5 +62,5 @@ tests: |
|
|||
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
|
|
@ -102,5 +102,5 @@ tests: |
|
|||
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
|
|
@ -63,5 +63,5 @@ tests: |
|
|||
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
|
|
@ -78,5 +78,5 @@ tests: |
|
|||
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
|
|
@ -59,5 +59,5 @@ tests: |
|
|||
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
|
|
@ -115,7 +115,7 @@ tests: |
|
|||
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
|
||||
methods:
|
||||
closest_monday: |
|
||||
|
|
|
@ -81,5 +81,5 @@ tests: |
|
|||
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
|
|
@ -87,5 +87,5 @@ tests: |
|
|||
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
|
|
@ -52,5 +52,5 @@ tests: |
|
|||
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
|
|
@ -77,5 +77,5 @@ tests: |
|
|||
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
|
|
@ -74,5 +74,5 @@ tests: |
|
|||
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
|
Loading…
Add table
Reference in a new issue