holidays/test/defs/test_defs_us.rb

24 lines
825 B
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/us.yaml, data/north_america_informal.yaml
class UsDefinitionTests < Test::Unit::TestCase # :nodoc:
def test_us
{Date.civil(2008,1,1) => 'New Year\'s Day',
Date.civil(2008,1,21) => 'Martin Luther King, Jr. Day',
Date.civil(2008,2,18) => 'Presidents\' Day',
Date.civil(2008,5,26) => 'Memorial Day',
Date.civil(2008,7,4) => 'Independence Day',
Date.civil(2008,9,1) => 'Labor Day',
Date.civil(2008,10,13) => 'Columbus Day',
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]
end
end
end