trading_day_jp 1.1.1 → 1.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/trading_day_jp/version.rb +1 -1
- data/lib/trading_day_jp.rb +1 -1
- data/spec/trading_day_jp_spec.rb +16 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e22e06c6d8ae2aba425a947e060c000ae9567293
|
4
|
+
data.tar.gz: a5b8c5f74ff30cf28374b48494b8408791b626e0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1b8992683ff03792447c3389b1d7ca04119dae903542e018b1d31256baee23856939833a371739ab4fc78db14f401c077070bf1274169d565078dd5348139995
|
7
|
+
data.tar.gz: 2053c20d8cf1a9aeb41944963b6e747ac593a71a68c46e842e7e0d3e84189c21b37f132ee0728581f95c3f0001d68f3e4a0dab2ebd5b247c6063977f0875bb47
|
data/lib/trading_day_jp.rb
CHANGED
data/spec/trading_day_jp_spec.rb
CHANGED
@@ -62,6 +62,14 @@ describe TradingDayJp do
|
|
62
62
|
it { expect(TradingDayJp.beginning_of_week date).to eq date }
|
63
63
|
end
|
64
64
|
|
65
|
+
context '日曜' do
|
66
|
+
it do
|
67
|
+
date = Date.new 2015, 1, 25
|
68
|
+
|
69
|
+
expect(TradingDayJp.beginning_of_week date).to eq Date.new(2015, 1, 19)
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
65
73
|
context 'その週は取引日がない' do
|
66
74
|
it 'returns nil' do
|
67
75
|
allow_any_instance_of(Date).to receive(:trading_day_jp?) { false }
|
@@ -80,6 +88,14 @@ describe TradingDayJp do
|
|
80
88
|
expect(TradingDayJp.end_of_week date).to eq Date.new(2014, 3, 20)
|
81
89
|
end
|
82
90
|
|
91
|
+
context '月曜' do
|
92
|
+
it do
|
93
|
+
date = Date.new 2015, 1, 5
|
94
|
+
|
95
|
+
expect(TradingDayJp.end_of_week date).to eq Date.new(2015, 1, 9)
|
96
|
+
end
|
97
|
+
end
|
98
|
+
|
83
99
|
context '日曜' do
|
84
100
|
it do
|
85
101
|
date = Date.new 2014, 2, 23
|