2010-11-12 21:45:12 +01:00
|
|
|
# encoding: utf-8
|
|
|
|
require File.expand_path(File.dirname(__FILE__)) + '/../test_helper'
|
2008-12-30 20:43:29 +01:00
|
|
|
|
|
|
|
# This file is generated by the Ruby Holiday gem.
|
|
|
|
#
|
|
|
|
# Definitions loaded: data/ca.yaml, data/north_america_informal.yaml
|
|
|
|
class CaDefinitionTests < Test::Unit::TestCase # :nodoc:
|
|
|
|
|
|
|
|
def test_ca
|
|
|
|
{Date.civil(2008,1,1) => 'New Year\'s Day',
|
|
|
|
Date.civil(2008,3,21) => 'Good Friday',
|
|
|
|
Date.civil(2008,3,24) => 'Easter Monday',
|
|
|
|
Date.civil(2008,5,19) => 'Victoria Day',
|
|
|
|
Date.civil(2008,7,1) => 'Canada Day',
|
|
|
|
Date.civil(2008,9,1) => 'Labour Day',
|
|
|
|
Date.civil(2008,10,13) => 'Thanksgiving',
|
2010-11-15 20:11:02 +01:00
|
|
|
Date.civil(2008,11,11) => 'Remembrance Day',
|
2008-12-30 20:43:29 +01:00
|
|
|
Date.civil(2008,12,25) => 'Christmas Day',
|
|
|
|
Date.civil(2008,12,26) => 'Boxing Day'}.each do |date, name|
|
2010-04-28 15:13:56 +02:00
|
|
|
assert_equal name, (Holidays.on(date, :ca, :informal)[0] || {})[:name]
|
2008-12-30 20:43:29 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
# Victoria Day
|
|
|
|
[Date.civil(2004,5,24), Date.civil(2005,5,23), Date.civil(2006,5,22),
|
|
|
|
Date.civil(2007,5,21), Date.civil(2008,5,19)].each do |date|
|
|
|
|
assert_equal 'Victoria Day', Holidays.on(date, :ca)[0][:name]
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|