roth_ira 1.2.2 → 1.2.3
Sign up to get free protection for your applications and to get access to all the features.
- 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 +70 -5
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: f260eb623b70f60674f2a8f5caa08998cf2cb72e
|
4
|
+
data.tar.gz: 68ec414d0b99e74e0d2ef9d84ced6392997f0447
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e40e7675b9f4f2f98e51fa91ba1c035fa19ac39f7db245f6b84ef13b1f70f722ab3719bd5d942870564d435bb21eb4008c9820c195653420b673fdec4ee231c7
|
7
|
+
data.tar.gz: a9207765334c015c69963f37bd5a2256282972e8b25522a6cf2f8af88d06e8876cedbe93145eb9f5f2b0621763908a65276239dc8d21a4fa1b28b6220fc8582c
|
data/lib/limits.yaml
CHANGED
@@ -89,3 +89,21 @@
|
|
89
89
|
:minimum_phase_out: 400
|
90
90
|
:catch_up_contribution: 1000
|
91
91
|
:catch_up_age: 50
|
92
|
+
2020:
|
93
|
+
:single:
|
94
|
+
:lower_income_limit: 124000
|
95
|
+
:upper_income_limit: 139000
|
96
|
+
:contribution_limit: 6000
|
97
|
+
:minimum_phase_out: 200
|
98
|
+
:head_of_household:
|
99
|
+
:lower_income_limit: 124000
|
100
|
+
:upper_income_limit: 139000
|
101
|
+
:contribution_limit: 6000
|
102
|
+
:minimum_phase_out: 200
|
103
|
+
:married_filing_jointly:
|
104
|
+
:lower_income_limit: 196000
|
105
|
+
:upper_income_limit: 206000
|
106
|
+
:contribution_limit: 12000
|
107
|
+
:minimum_phase_out: 400
|
108
|
+
:catch_up_contribution: 1000
|
109
|
+
: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, 2020)
|
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.3')
|
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 2020' do
|
14
|
+
expect{RothIRA.new(2021)}.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 2020' do
|
24
|
+
expect{RothIRA.new(2020)}.to_not raise_error
|
25
25
|
end
|
26
26
|
end
|
27
27
|
|
@@ -461,4 +461,69 @@ describe RothIRA do
|
|
461
461
|
end
|
462
462
|
end
|
463
463
|
end
|
464
|
+
|
465
|
+
context 'Tax year 2020' do
|
466
|
+
let(:roth_ira) { RothIRA.new(2020) }
|
467
|
+
context 'Single' do
|
468
|
+
it 'returns maximum contribution for bottom of income limit' do
|
469
|
+
expect(roth_ira.calculate(124000, :single, 40)).to eq(6000)
|
470
|
+
end
|
471
|
+
|
472
|
+
it 'returns maximum contribution for bottom of income limit with catch-up' do
|
473
|
+
expect(roth_ira.calculate(124000, :single, 50)).to eq(7000)
|
474
|
+
end
|
475
|
+
|
476
|
+
it 'returns zero contribution for top of income limit' do
|
477
|
+
expect(roth_ira.calculate(139000, :single, 40)).to eq(0)
|
478
|
+
end
|
479
|
+
|
480
|
+
it 'returns zero contribution for top of income limit with catch-up' do
|
481
|
+
expect(roth_ira.calculate(139000, :single, 50)).to eq(0)
|
482
|
+
end
|
483
|
+
end
|
484
|
+
|
485
|
+
context 'Head of Household' do
|
486
|
+
it 'returns maximum contribution for bottom of income limit' do
|
487
|
+
expect(roth_ira.calculate(124000, :head_of_household, 40)).to eq(6000)
|
488
|
+
end
|
489
|
+
|
490
|
+
it 'returns maximum contribution for bottom of income limit with catch-up' do
|
491
|
+
expect(roth_ira.calculate(124000, :head_of_household, 50)).to eq(7000)
|
492
|
+
end
|
493
|
+
|
494
|
+
it 'returns zero contribution for top of income limit' do
|
495
|
+
expect(roth_ira.calculate(139000, :head_of_household, 40)).to eq(0)
|
496
|
+
end
|
497
|
+
|
498
|
+
it 'returns maximum contribution for bottom of income limit with catch-up' do
|
499
|
+
expect(roth_ira.calculate(139000, :head_of_household, 50)).to eq(0)
|
500
|
+
end
|
501
|
+
end
|
502
|
+
|
503
|
+
context 'Married Filing Jointly' do
|
504
|
+
it 'returns maximum contribution for bottom of income limit' do
|
505
|
+
expect(roth_ira.calculate(196000, :married_filing_jointly, 40, 40)).to eq(12000)
|
506
|
+
end
|
507
|
+
|
508
|
+
it 'returns maximum contribution for bottom of income limit with one catch-up' do
|
509
|
+
expect(roth_ira.calculate(196000, :married_filing_jointly, 40, 50)).to eq(13000)
|
510
|
+
end
|
511
|
+
|
512
|
+
it 'returns maximum contribution for bottom of income limit with both catch-up' do
|
513
|
+
expect(roth_ira.calculate(196000, :married_filing_jointly, 50, 50)).to eq(14000)
|
514
|
+
end
|
515
|
+
|
516
|
+
it 'returns zero contribution for top of income limit' do
|
517
|
+
expect(roth_ira.calculate(206000, :married_filing_jointly, 40, 40)).to eq(0)
|
518
|
+
end
|
519
|
+
|
520
|
+
it 'returns zero contribution for top of income limit with one catch-up' do
|
521
|
+
expect(roth_ira.calculate(206000, :married_filing_jointly, 40, 50)).to eq(0)
|
522
|
+
end
|
523
|
+
|
524
|
+
it 'returns zero contribution for top of income limit with both catch-up' do
|
525
|
+
expect(roth_ira.calculate(206000, :married_filing_jointly, 50, 50)).to eq(0)
|
526
|
+
end
|
527
|
+
end
|
528
|
+
end
|
464
529
|
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.3
|
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: 2020-02-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -57,7 +57,7 @@ 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.6.11
|
61
61
|
signing_key:
|
62
62
|
specification_version: 4
|
63
63
|
summary: Roth IRA Contribution Limit Calculator
|