roth_ira 1.2.1 → 1.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 +5 -5
- data/lib/limits.yaml +18 -0
- data/lib/roth_ira.rb +1 -1
- data/lib/roth_ira/version.rb +1 -1
- data/spec/roth_ira_spec.rb +76 -11
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 3b4d9573d6efb1ff7aad5b46461054344c6342f1fa18c691841028864b747195
|
4
|
+
data.tar.gz: 48cabe6645d77f44bf21fb1e4c7db03221da2bd6f299cb5d1e20cb4bd3540ee7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 100d3e11c09f6692361a64c58c350dc46f63e6de946c014e184d088795d0131c42b097f4a67e181101611a5f83ed1a668e53b53a8554a4f3ec69650e81c8dd35
|
7
|
+
data.tar.gz: 0bfc00ffc4b1b02c0c0d0ea1557c0b791185a053f39d1fa99201a1acb5ebba3f3484bce7f7893e8d0c8abbcf5ed9ba3981e5c6a79004623d337e16138fead47b
|
data/lib/limits.yaml
CHANGED
@@ -71,3 +71,21 @@
|
|
71
71
|
:minimum_phase_out: 400
|
72
72
|
:catch_up_contribution: 1000
|
73
73
|
:catch_up_age: 50
|
74
|
+
2019:
|
75
|
+
:single:
|
76
|
+
:lower_income_limit: 122000
|
77
|
+
:upper_income_limit: 137000
|
78
|
+
:contribution_limit: 6000
|
79
|
+
:minimum_phase_out: 200
|
80
|
+
:head_of_household:
|
81
|
+
:lower_income_limit: 122000
|
82
|
+
:upper_income_limit: 137000
|
83
|
+
:contribution_limit: 6000
|
84
|
+
:minimum_phase_out: 200
|
85
|
+
:married_filing_jointly:
|
86
|
+
:lower_income_limit: 193000
|
87
|
+
:upper_income_limit: 203000
|
88
|
+
:contribution_limit: 12000
|
89
|
+
:minimum_phase_out: 400
|
90
|
+
:catch_up_contribution: 1000
|
91
|
+
:catch_up_age: 50
|
data/lib/roth_ira.rb
CHANGED
@@ -4,7 +4,7 @@ class RothIRA
|
|
4
4
|
attr_reader :age, :agi, :filing_status, :limits, :spouse_age, :year
|
5
5
|
|
6
6
|
def initialize(year)
|
7
|
-
raise(ArgumentError, "Invalid Tax Year #{year}") unless year.between?(2015,
|
7
|
+
raise(ArgumentError, "Invalid Tax Year #{year}") unless year.between?(2015, 2019)
|
8
8
|
@year = year
|
9
9
|
@limits = YAML.load(File.read(__dir__ + "/limits.yaml"))[year]
|
10
10
|
end
|
data/lib/roth_ira/version.rb
CHANGED
data/spec/roth_ira_spec.rb
CHANGED
@@ -2,7 +2,7 @@ require 'spec_helper'
|
|
2
2
|
|
3
3
|
describe RothIRA do
|
4
4
|
it 'should return correct version string' do
|
5
|
-
expect(RothIRA::VERSION).to eq('1.2.
|
5
|
+
expect(RothIRA::VERSION).to eq('1.2.2')
|
6
6
|
end
|
7
7
|
|
8
8
|
context 'Invalid tax years' do
|
@@ -10,8 +10,8 @@ describe RothIRA do
|
|
10
10
|
expect{RothIRA.new(2014)}.to raise_error ArgumentError
|
11
11
|
end
|
12
12
|
|
13
|
-
it 'should raise an ArgumentError if tax year is after
|
14
|
-
expect{RothIRA.new(
|
13
|
+
it 'should raise an ArgumentError if tax year is after 2019' do
|
14
|
+
expect{RothIRA.new(2020)}.to raise_error ArgumentError
|
15
15
|
end
|
16
16
|
end
|
17
17
|
|
@@ -20,8 +20,8 @@ describe RothIRA do
|
|
20
20
|
expect{RothIRA.new(2015)}.to_not raise_error
|
21
21
|
end
|
22
22
|
|
23
|
-
it 'should not raise an ArgumentError if tax year is
|
24
|
-
expect{RothIRA.new(
|
23
|
+
it 'should not raise an ArgumentError if tax year is 2019' do
|
24
|
+
expect{RothIRA.new(2019)}.to_not raise_error
|
25
25
|
end
|
26
26
|
end
|
27
27
|
|
@@ -282,7 +282,7 @@ describe RothIRA do
|
|
282
282
|
expect(roth_ira.calculate(133000, :single, 40)).to eq(0)
|
283
283
|
end
|
284
284
|
|
285
|
-
it 'returns
|
285
|
+
it 'returns zero contribution for top of income limit with catch-up' do
|
286
286
|
expect(roth_ira.calculate(133000, :single, 50)).to eq(0)
|
287
287
|
end
|
288
288
|
end
|
@@ -322,11 +322,11 @@ describe RothIRA do
|
|
322
322
|
expect(roth_ira.calculate(196000, :married_filing_jointly, 40, 40)).to eq(0)
|
323
323
|
end
|
324
324
|
|
325
|
-
it 'returns
|
325
|
+
it 'returns zero contribution for top of income limit with one catch-up' do
|
326
326
|
expect(roth_ira.calculate(196000, :married_filing_jointly, 40, 50)).to eq(0)
|
327
327
|
end
|
328
328
|
|
329
|
-
it 'returns
|
329
|
+
it 'returns zero contribution for top of income limit with both catch-up' do
|
330
330
|
expect(roth_ira.calculate(196000, :married_filing_jointly, 50, 50)).to eq(0)
|
331
331
|
end
|
332
332
|
end
|
@@ -347,7 +347,7 @@ describe RothIRA do
|
|
347
347
|
expect(roth_ira.calculate(135000, :single, 40)).to eq(0)
|
348
348
|
end
|
349
349
|
|
350
|
-
it 'returns
|
350
|
+
it 'returns zero contribution for top of income limit with catch-up' do
|
351
351
|
expect(roth_ira.calculate(135000, :single, 50)).to eq(0)
|
352
352
|
end
|
353
353
|
end
|
@@ -387,13 +387,78 @@ describe RothIRA do
|
|
387
387
|
expect(roth_ira.calculate(199000, :married_filing_jointly, 40, 40)).to eq(0)
|
388
388
|
end
|
389
389
|
|
390
|
-
it 'returns
|
390
|
+
it 'returns zero contribution for top of income limit with one catch-up' do
|
391
391
|
expect(roth_ira.calculate(199000, :married_filing_jointly, 40, 50)).to eq(0)
|
392
392
|
end
|
393
393
|
|
394
|
-
it 'returns
|
394
|
+
it 'returns zero contribution for top of income limit with both catch-up' do
|
395
395
|
expect(roth_ira.calculate(199000, :married_filing_jointly, 50, 50)).to eq(0)
|
396
396
|
end
|
397
397
|
end
|
398
398
|
end
|
399
|
+
|
400
|
+
context 'Tax year 2019' do
|
401
|
+
let(:roth_ira) { RothIRA.new(2019) }
|
402
|
+
context 'Single' do
|
403
|
+
it 'returns maximum contribution for bottom of income limit' do
|
404
|
+
expect(roth_ira.calculate(122000, :single, 40)).to eq(6000)
|
405
|
+
end
|
406
|
+
|
407
|
+
it 'returns maximum contribution for bottom of income limit with catch-up' do
|
408
|
+
expect(roth_ira.calculate(122000, :single, 50)).to eq(7000)
|
409
|
+
end
|
410
|
+
|
411
|
+
it 'returns zero contribution for top of income limit' do
|
412
|
+
expect(roth_ira.calculate(137000, :single, 40)).to eq(0)
|
413
|
+
end
|
414
|
+
|
415
|
+
it 'returns zero contribution for top of income limit with catch-up' do
|
416
|
+
expect(roth_ira.calculate(137000, :single, 50)).to eq(0)
|
417
|
+
end
|
418
|
+
end
|
419
|
+
|
420
|
+
context 'Head of Household' do
|
421
|
+
it 'returns maximum contribution for bottom of income limit' do
|
422
|
+
expect(roth_ira.calculate(122000, :head_of_household, 40)).to eq(6000)
|
423
|
+
end
|
424
|
+
|
425
|
+
it 'returns maximum contribution for bottom of income limit with catch-up' do
|
426
|
+
expect(roth_ira.calculate(122000, :head_of_household, 50)).to eq(7000)
|
427
|
+
end
|
428
|
+
|
429
|
+
it 'returns zero contribution for top of income limit' do
|
430
|
+
expect(roth_ira.calculate(137000, :head_of_household, 40)).to eq(0)
|
431
|
+
end
|
432
|
+
|
433
|
+
it 'returns maximum contribution for bottom of income limit with catch-up' do
|
434
|
+
expect(roth_ira.calculate(137000, :head_of_household, 50)).to eq(0)
|
435
|
+
end
|
436
|
+
end
|
437
|
+
|
438
|
+
context 'Married Filing Jointly' do
|
439
|
+
it 'returns maximum contribution for bottom of income limit' do
|
440
|
+
expect(roth_ira.calculate(193000, :married_filing_jointly, 40, 40)).to eq(12000)
|
441
|
+
end
|
442
|
+
|
443
|
+
it 'returns maximum contribution for bottom of income limit with one catch-up' do
|
444
|
+
expect(roth_ira.calculate(193000, :married_filing_jointly, 40, 50)).to eq(13000)
|
445
|
+
end
|
446
|
+
|
447
|
+
it 'returns maximum contribution for bottom of income limit with both catch-up' do
|
448
|
+
expect(roth_ira.calculate(193000, :married_filing_jointly, 50, 50)).to eq(14000)
|
449
|
+
end
|
450
|
+
|
451
|
+
it 'returns zero contribution for top of income limit' do
|
452
|
+
expect(roth_ira.calculate(203000, :married_filing_jointly, 40, 40)).to eq(0)
|
453
|
+
end
|
454
|
+
|
455
|
+
it 'returns zero contribution for top of income limit with one catch-up' do
|
456
|
+
expect(roth_ira.calculate(203000, :married_filing_jointly, 40, 50)).to eq(0)
|
457
|
+
end
|
458
|
+
|
459
|
+
it 'returns zero contribution for top of income limit with both catch-up' do
|
460
|
+
expect(roth_ira.calculate(203000, :married_filing_jointly, 50, 50)).to eq(0)
|
461
|
+
end
|
462
|
+
end
|
463
|
+
end
|
399
464
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: roth_ira
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Randall Reed
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-10-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -57,10 +57,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
57
57
|
version: '0'
|
58
58
|
requirements: []
|
59
59
|
rubyforge_project:
|
60
|
-
rubygems_version: 2.
|
60
|
+
rubygems_version: 2.7.7
|
61
61
|
signing_key:
|
62
62
|
specification_version: 4
|
63
63
|
summary: Roth IRA Contribution Limit Calculator
|
64
64
|
test_files:
|
65
|
-
- spec/roth_ira_spec.rb
|
66
65
|
- spec/spec_helper.rb
|
66
|
+
- spec/roth_ira_spec.rb
|