Skip to content

A platform for community discussion. Free, open, simple.

2.0 KB
Raw Blame
# Informal North American holiday definitions for the Ruby Holiday gem.
# Updated 2008-11-22.
---
months:
  2:
  - name: Groundhog Day
    regions: [us, ca]
    mday: 2
    type: informal
  - name: Valentine's Day
    regions: [us, ca]
    mday: 14
    type: informal
  3:
  - name: St. Patrick's Day
    regions: [us, ca]
    mday: 17
    type: informal
  4:
  - name: April Fool's Day
    regions: [us, ca]
    mday: 1
    type: informal
  - name: Earth Day
    regions: [us, ca]
    mday: 22
    type: informal
  5:
  - name: Mother's Day
    week: 2
    regions: [us, ca]
    wday: 0
    type: informal
  - name: Armed Forces Day
    week: 3
    regions: [us]
    wday: 6
    type: informal
  6:
  - name: Father's Day
    week: 3
    regions: [us, ca]
    wday: 0
    type: informal
  10:
  - name: Halloween
    regions: [us, ca]
    mday: 31
    type: informal

tests:
  - given:
      date: '2013-02-02'
      regions: ["us"]
      options: ["informal"]
    expect:
      name: "Groundhog Day"
  - given:
      date: '2013-02-14'
      regions: ["us"]
      options: ["informal"]
    expect:
      name: "Valentine's Day"
  - given:
      date: '2013-03-17'
      regions: ["us"]
      options: ["informal"]
    expect:
      name: "St. Patrick's Day"
  - given:
      date: '2013-04-01'
      regions: ["us"]
      options: ["informal"]
    expect:
      name: "April Fool's Day"
  - given:
      date: '2013-04-22'
      regions: ["us"]
      options: ["informal"]
    expect:
      name: "Earth Day"
  - given:
      date: '2013-05-12'
      regions: ["us"]
      options: ["informal"]
    expect:
      name: "Mother's Day"
  - given:
      date: '2013-05-18'
      regions: ["us"]
      options: ["informal"]
    expect:
      name: "Armed Forces Day"
  - given:
      date: '2013-06-16'
      regions: ["us"]
      options: ["informal"]
    expect:
      name: "Father's Day"
  - given:
      date: '2013-10-31'
      regions: ["us"]
      options: ["informal"]
    expect:
      name: "Halloween"