Skip to content

Commit

Permalink
updated definition files
Browse files Browse the repository at this point in the history
  • Loading branch information
adamstrickland committed Feb 7, 2013
1 parent 99c1d94 commit b130b57
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/holidays/nerc.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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]}],
Expand Down
4 changes: 3 additions & 1 deletion test/defs/test_defs_nerc.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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.