fat_core 0.2.1 → 0.2.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: b48c133a3c373bf4b5827e7079453c5a7a7a2d5c
4
- data.tar.gz: 1cf5a94914da4da0c8b4fb4416177fde3917c10a
3
+ metadata.gz: b9fb47fa0fa82d7e1123e64ff79386a40ec64081
4
+ data.tar.gz: 712a346af001436071a8429ddcadc772c3ecd31b
5
5
  SHA512:
6
- metadata.gz: bab94931282848e1ba912a5239bb02666513a2b3099d12e30b48b39bd99997d938fb4c39c5861f4d18bd75211ca6e680825e02146b34f7bedb82820749f2bcc3
7
- data.tar.gz: 993dbd9065f30eff2e5d1b0f26fc6b512d796323294cea57e32900c91a149e6b3776f7fbab0e026103b3f83805eaca3fad5dd154f338307c45c5607ac5f8b0f2
6
+ metadata.gz: e1825b694209cee54cd34fd6a3140875181fefde1e39744c3cc999d64ba9dfe0a85fa6b846f59ad80b49a8cf9a855b027969197a2c6e2256c421600a2537085d
7
+ data.tar.gz: 645b35b380af7532e49001b58b627915a70c882ebc2f5aeae51c75eb6873113722d767b7e1fd5e4c4c64c723486411b69fa0fe5eb94c95c19afc8a02383ca7b7
@@ -128,8 +128,8 @@ class Date
128
128
  when /^(this_?)?biweek/
129
129
  spec_type == :from ? today.beginning_of_biweek : today.end_of_biweek
130
130
  when /last_?biweek/
131
- spec_type == :from ? (today - 1.week).beginning_of_biweek :
132
- (today - 1.week).end_of_biweek
131
+ spec_type == :from ? (today - 2.week).beginning_of_biweek :
132
+ (today - 2.week).end_of_biweek
133
133
  when /^(this_?)?semimonth/
134
134
  spec_type == :from ? today.beginning_of_semimonth : today.end_of_semimonth
135
135
  when /^last_?semimonth/
@@ -143,8 +143,8 @@ class Date
143
143
  when /^(this_?)?bimonth/
144
144
  spec_type == :from ? today.beginning_of_bimonth : today.end_of_bimonth
145
145
  when /^last_?bimonth/
146
- spec_type == :from ? (today - 1.month).beginning_of_bimonth :
147
- (today - 1.month).end_of_bimonth
146
+ spec_type == :from ? (today - 2.month).beginning_of_bimonth :
147
+ (today - 2.month).end_of_bimonth
148
148
  when /^(this_?)?quarter/
149
149
  spec_type == :from ? today.beginning_of_quarter : today.end_of_quarter
150
150
  when /^last_?quarter/
@@ -1,7 +1,7 @@
1
1
  module FatCore
2
2
  MAJOR = 0
3
3
  MINOR = 2
4
- PATCH = 1
4
+ PATCH = 2
5
5
 
6
6
  VERSION = [MAJOR, MINOR, PATCH].compact.join('.')
7
7
  end
@@ -201,6 +201,7 @@ describe Date do
201
201
  end
202
202
 
203
203
  describe "parse_spec" do
204
+ # For these tests, today is 2012-07-18
204
205
 
205
206
  it "should choke if spec type is neither :from or :to" do
206
207
  expect {
@@ -311,6 +312,18 @@ describe Date do
311
312
  expect(Date.parse_spec('this_bimonth', :to)).to eq Date.parse('2012-08-31')
312
313
  expect(Date.parse_spec('last_bimonth')).to eq Date.parse('2012-05-01')
313
314
  expect(Date.parse_spec('last_bimonth', :to)).to eq Date.parse('2012-06-30')
315
+
316
+ # Set today to 2014-12-12: Found that last_bimonth was reporting
317
+ # current bimonth when today was in the second month of the current
318
+ # bimonth, i.e., an even month
319
+ allow(Date).to receive_messages(:today => Date.parse('2014-12-12'))
320
+ allow(Date).to receive_messages(:current => Date.parse('2014-12-12'))
321
+
322
+ expect(Date.parse_spec('last_bimonth')).to eq Date.parse('2014-09-01')
323
+ expect(Date.parse_spec('last_bimonth', :to)).to eq Date.parse('2014-10-31')
324
+
325
+ allow(Date).to receive_messages(:today => Date.parse('2012-07-18'))
326
+ allow(Date).to receive_messages(:current => Date.parse('2012-07-18'))
314
327
  end
315
328
 
316
329
  it "should parse relative quarters: this_quarter, last_quarter" do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fat_core
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel E. Doherty
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-12-02 00:00:00.000000000 Z
11
+ date: 2014-12-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: simplecov