Permalink
Browse files

updated definition files

  • Loading branch information...
1 parent 99c1d94 commit b130b57ded520b6e07445e530b4efe031e5c5b2c @adamstrickland adamstrickland committed Feb 7, 2013
Showing with 4 additions and 2 deletions.
  1. +1 −1 lib/holidays/nerc.rb
  2. +3 −1 test/defs/test_defs_nerc.rb
@@ -18,7 +18,7 @@ def self.defined_regions
def self.holidays_by_month
{
- 1 => [{:mday => 1, :name => "New Year's Day", :regions => [:nerc]}],
+ 1 => [{:mday => 1, :observed => lambda { |date| Holidays.to_weekday_if_weekend(date) }, :observed_id => "to_weekday_if_weekend", :name => "New Year's Day", :regions => [:nerc]}],
5 => [{:wday => 1, :week => -1, :name => "Memorial Day", :regions => [:nerc]}],
7 => [{:mday => 4, :observed => lambda { |date| Holidays.to_weekday_if_weekend(date) }, :observed_id => "to_weekday_if_weekend", :name => "Independence Day", :regions => [:nerc]}],
9 => [{:wday => 1, :week => 1, :name => "Labor Day", :regions => [:nerc]}],
@@ -7,13 +7,15 @@
class NercDefinitionTests < Test::Unit::TestCase # :nodoc:
def test_nerc
-{Date.civil(2013,1,1) => 'New Year\'s Day',
+{Date.civil(2013,1,1) => 'New Year\'s Day',
+ Date.civil(2017,1,2) => 'New Year\'s Day',
Date.civil(2013,5,27) => 'Memorial Day',
Date.civil(2013,7,4) => 'Independence Day',
Date.civil(2013,9,2) => 'Labor Day',
Date.civil(2013,11,28) => 'Thanksgiving',
Date.civil(2013,12,25) => 'Christmas Day'}.each do |date, name|
assert_equal name, (Holidays.on(date, :nyse)[0] || {})[:name]
end
+
end
end

0 comments on commit b130b57

Please sign in to comment.