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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e315bfe807f4ff907de1ba0d03da3a51f3290d55
4
- data.tar.gz: 7cd6adc0580c37f497966de34407c1603264f750
3
+ metadata.gz: e22e06c6d8ae2aba425a947e060c000ae9567293
4
+ data.tar.gz: a5b8c5f74ff30cf28374b48494b8408791b626e0
5
5
  SHA512:
6
- metadata.gz: a979fdd2f7fe3835023b88b62901da8672cd054fc92af7586e11841e88b3f499b4d853619473429ee14f8b8e9c6d23df28133b9d8c4aafa06faa7797816edd45
7
- data.tar.gz: 257734a3cbbbdfe7ca6cebc639175f596ebbabdee7f308c8203e5927682caad65e800035e6d2db3e651a03756576e48ea1b8dd98bbe354471ee57992188cc7eb
6
+ metadata.gz: 1b8992683ff03792447c3389b1d7ca04119dae903542e018b1d31256baee23856939833a371739ab4fc78db14f401c077070bf1274169d565078dd5348139995
7
+ data.tar.gz: 2053c20d8cf1a9aeb41944963b6e747ac593a71a68c46e842e7e0d3e84189c21b37f132ee0728581f95c3f0001d68f3e4a0dab2ebd5b247c6063977f0875bb47
@@ -1,3 +1,3 @@
1
1
  module TradingDayJp
2
- VERSION = "1.1.1"
2
+ VERSION = "1.1.2"
3
3
  end
@@ -4,7 +4,7 @@ module TradingDayJp
4
4
 
5
5
  class << self
6
6
  @@day_minus = [nil, 0, 1, 2, 3, 4, 5, 6]
7
- @@day_add = [nil, 0, 4, 3, 2, 1, 0, -1, -2]
7
+ @@day_add = [nil, 4, 3, 2, 1, 0, -1, -2]
8
8
 
9
9
  def open?(date)
10
10
  date.trading_day_jp?
@@ -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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: trading_day_jp
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Takehiko Shinkura