mudrat_projector 0.9.4 → 0.9.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d2181d2b58ff6ff66fc876cb0a69b95c40a73cb8
4
- data.tar.gz: 506905ae2d682c9c3dd13712ad381fc2ba71b418
3
+ metadata.gz: 62d4da3d4855b86d2afaef5a0146ccdfa78ae71a
4
+ data.tar.gz: 06bd1025c3d0f8e376a33d51b0a89a606e2097af
5
5
  SHA512:
6
- metadata.gz: efafce27f94ec1a5c2a96535cd09fe6a3db785fe5581804cf0e7bd040b1d7adbf39e723d3c0bd55bec33325d4371aa59ac1dc6c19e73b8db7666cf037ab6ae1d
7
- data.tar.gz: e3cd5fc24943b3ba408d68fb4ae2c5cefc484f4f1d425b39ed58fb8530791bb1323928daf3a3f6813d4e53d97a9a9805b6eb22c57a91d454403443eaf7dfbc88
6
+ metadata.gz: 192c4b4640f77aba3dbee931d6c262a67dd7ff3bce278989e6e65d4e384235c65c9d13bb767ef9c65d566748095b63f8db9771a0908621b1024ec7dc558e91e5
7
+ data.tar.gz: 6226f886e876b22209f3f8dbb3fea1da976b89e2caee049e102a21e9cb2de0cc79eea12d3d9bfd19568f0f4dbab0491aac52b13c20b76e0591e0949c4aa9d584
@@ -7,6 +7,7 @@ module MudratProjector
7
7
  end
8
8
 
9
9
  def << transaction
10
+ defer(transaction) and return if transaction.date > @projection.range.end
10
11
  in_projection, leftover = transaction.slice @projection.range.end
11
12
  @projection.add_transaction_batch in_projection
12
13
  defer leftover if leftover
@@ -1,3 +1,3 @@
1
1
  module MudratProjector
2
- VERSION = "0.9.4"
2
+ VERSION = "0.9.5"
3
3
  end
@@ -66,10 +66,9 @@ class DateDiffTest < Minitest::Test
66
66
  end
67
67
 
68
68
  def test_full_years
69
- dec_12_2004 = Date.new 2004, 12, 31
70
- assert_equal 5.0, date_diff(:year, jan_1_2000, dec_12_2004)
71
- assert_equal 20.0, date_diff(:quarter, jan_1_2000, dec_12_2004)
72
- assert_equal 60.0, date_diff(:month, jan_1_2000, dec_12_2004)
69
+ assert_equal 5.0, date_diff(:year, jan_1_2000, dec_31_2004)
70
+ assert_equal 20.0, date_diff(:quarter, jan_1_2000, dec_31_2004)
71
+ assert_equal 60.0, date_diff(:month, jan_1_2000, dec_31_2004)
73
72
  end
74
73
 
75
74
  def test_a_year_and_four_days_across_a_leap_year
@@ -160,19 +160,6 @@ class ProjectorTransactionTest < Minitest::Test
160
160
  assert_equal 1500000, @projector.net_worth
161
161
  end
162
162
 
163
- def test_annual_transactions
164
- @projector.add_transaction(
165
- date: apr_1_2012,
166
- credit: { amount: 50000, account_id: :nustartup_inc },
167
- debit: { amount: 50000, account_id: :checking },
168
- schedule: { scalar: 12, unit: :month },
169
- )
170
-
171
- @projector.project to: mar_31_2042
172
-
173
- assert_equal 1500000, @projector.net_worth
174
- end
175
-
176
163
  private
177
164
 
178
165
  def add_scheduled_transaction date = jan_1_2000
@@ -37,6 +37,13 @@ class TransactionHandlerTest < Minitest::Test
37
37
  assert_equal 1, next_projector.transactions.size
38
38
  end
39
39
 
40
+ def test_routes_future_transaction_into_next_projector
41
+ @transaction_handler.next_projector = next_projector
42
+ @transaction_handler << scheduled_transaction(start_date: jan_1_2040, end_date: jan_1_2041)
43
+ assert_equal 0, @projection.transaction_sequence.size
44
+ assert_equal 1, next_projector.transactions.size
45
+ end
46
+
40
47
  private
41
48
 
42
49
  def fixed_transaction date: jan_1_2000, amount: 1000
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mudrat_projector
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.4
4
+ version: 0.9.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - ntl
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-12-22 00:00:00.000000000 Z
11
+ date: 2013-12-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler