Created
January 3, 2013 21:40
-
-
Save gabetax/4447578 to your computer and use it in GitHub Desktop.
Custom holidays with the holidays gem
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
months: | |
0: | |
- name: Mardi Gras | |
regions: [bank] | |
function: easter(year)-47 | |
11: | |
- name: Black Friday | |
week: -1 | |
regions: [bank] | |
wday: 5 | |
tests: | | |
{Date.civil(2013,2,12) => 'Mardi Gras', | |
Date.civil(2013,11,29) => 'Black Friday'}.each do |date, name| | |
assert_equal name, (Holidays.on(date, :bank)[0] || {})[:name] | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment