-
Notifications
You must be signed in to change notification settings - Fork 136
/
fedex.yaml
102 lines (100 loc) · 2 KB
/
fedex.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
# FedEx holiday definitions for the Ruby Holiday gem.
#
# By Adam Runner
#
# Updated: 2015-03-09.
# Source: http://www.fedex.com/us/service-guide/holiday-schedule.html
---
months:
1:
- name: New Year's Day
regions: [fedex]
mday: 1
observed: to_weekday_if_weekend(date)
5:
- name: Memorial Day
week: -1
regions: [fedex]
wday: 1
7:
- name: Independence Day
regions: [fedex]
mday: 4
observed: to_weekday_if_weekend(date)
9:
- name: Labor Day
week: 1
regions: [fedex]
wday: 1
11:
- name: Thanksgiving
week: 4
regions: [fedex]
wday: 4
- name: Day After Thanksgiving
function: day_after_thanksgiving(year)
regions: [fedex]
12:
- name: Christmas Day
regions: [fedex]
mday: 25
observed: to_weekday_if_weekend(date)
- name: New Year's Eve
regions: [fedex]
mday: 31
methods:
day_after_thanksgiving:
arguments: year
ruby: |
Holidays::Factory::DateCalculator.day_of_month_calculator.call(year, 11, 4, 4) + 1
tests:
- given:
date: '2015-01-01'
regions: ["ups"]
expect:
name: "New Year's Day"
- given:
date: '2015-05-25'
regions: ["ups"]
expect:
name: "Memorial Day"
- given:
date: '2015-07-04'
regions: ["ups"]
expect:
name: "Independence Day"
- given:
date: '2015-09-07'
regions: ["ups"]
expect:
name: "Labor Day"
- given:
date: '2015-11-26'
regions: ["ups"]
expect:
name: "Thanksgiving"
- given:
date: '2015-11-27'
regions: ["ups"]
expect:
name: "Day After Thanksgiving"
- given:
date: '2013-11-28'
regions: ["ups"]
expect:
name: "Thanksgiving"
- given:
date: '2013-11-29'
regions: ["ups"]
expect:
name: "Day After Thanksgiving"
- given:
date: '2015-12-25'
regions: ["ups"]
expect:
name: "Christmas Day"
- given:
date: '2015-12-31'
regions: ["ups"]
expect:
name: "New Year's Eve"