holidays/test/defs/test_defs_es.rb

58 lines
2.5 KiB
Ruby

# encoding: utf-8
require File.expand_path(File.dirname(__FILE__)) + '/../test_helper'
# This file is generated by the Ruby Holiday gem.
#
# Definitions loaded: data/es.yaml
class EsDefinitionTests < Test::Unit::TestCase # :nodoc:
def test_es
{Date.civil(2009,1,1) => 'Año Nuevo',
Date.civil(2009,1,6) => 'Día de Reyes',
Date.civil(2009,4,10) => 'Viernes Santo',
Date.civil(2009,5,1) => 'Día del Trabajador',
Date.civil(2009,8,15) => 'Asunción',
Date.civil(2009,10,12) => 'Día de la Hispanidad',
Date.civil(2009,11,1) => 'Todos los Santos',
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]
end
[:es_pv, :es_ct, :es_na, :es_v, :es_vc, :es_].each do |r|
assert_equal 'Jueves Santo', Date.civil(2009,4,9).holidays(r)[0][:name]
assert_equal 'Lunes de Pascua', Date.civil(2009,4,13).holidays(r)[0][:name]
end
[:es_v, :es_vc, :es_cm, :es_mu, :es_m, :es_].each do |r|
assert_equal 'San José', Date.civil(2009,3,19).holidays(r)[0][:name]
end
[:es_ar, :es_cl, :es_].each do |r|
assert_equal 'San Jorge', Date.civil(2009,4,23).holidays(r)[0][:name]
end
[:es_vc, :es_v, :es_].each do |r|
assert_equal 'Día de Valencia', Date.civil(2009,10,9).holidays(r)[0][:name]
end
[:es_ib, :es_ct, :es_].each do |r|
assert_equal 'San Esteban', Date.civil(2009,12,26).holidays(r)[0][:name]
end
assert_equal 'Día de Andalucía', Date.civil(2009,2,28).holidays(:es_an)[0][:name]
assert_equal 'Día de las Islas Baleares', Date.civil(2009,3,1).holidays(:es_ib)[0][:name]
assert_equal 'Fiesta de la Comunidad', Date.civil(2006,5,2).holidays(:es_m)[0][:name]
assert_equal 'Día de las Canarias', Date.civil(2006,5,30).holidays(:es_cn)[0][:name]
assert_equal 'Día de la Región Castilla-La Mancha', Date.civil(2009,5,31).holidays(:es_cm)[0][:name]
assert_equal 'Día de la Región de Murcia', Date.civil(2009,6,9).holidays(:es_mu)[0][:name]
assert_equal 'Día de La Rioja', Date.civil(2009,6,9).holidays(:es_lo)[0][:name]
assert_equal 'Santiago Apostol', Date.civil(2009,7,23).holidays(:es_ga)[0][:name]
assert_equal 'Día de Ceuta', Date.civil(2009,9,2).holidays(:es_ce)[0][:name]
assert_equal 'Día de Asturias', Date.civil(2009,9,8).holidays(:es_o)[0][:name]
assert_equal 'Día de Extremadura', Date.civil(2009,9,8).holidays(:es_ex)[0][:name]
assert_equal 'Fiesta Nacional de Cataluña', Date.civil(2009,9,11).holidays(:es_ct)[0][:name]
end
end