holidays/test/defs/test_defs_nyse.rb

23 lines
734 B
Ruby

require File.dirname(__FILE__) + '/../test_helper'
require 'holidays/nyse'
# This file is generated by the Ruby Holiday gem.
#
# Definitions loaded: data/nyse.yaml
class NyseDefinitionTests < Test::Unit::TestCase # :nodoc:
def test_nyse
{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,3,21) => 'Good Friday',
Date.civil(2008,5,26) => 'Memorial Day',
Date.civil(2008,7,4) => 'Independence Day',
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]
end
end
end