roth_ira 1.2.3 → 1.2.4
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 +70 -5
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 3155b94595d63a3e421e6dd8ed4571de34881c50d5fea1511f9b9e6468cf0f24
|
4
|
+
data.tar.gz: c908b024f19f20ada8b4d4955262aa207ec74a66e57c929d06306a02f1d64c8f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 45f27013b2d7f9e2993f76f7ca58ef13d57119cd116f090c9f7532608c7f4c6783feaa5224ab40893d4b2c67decca2d2a570537e1d0b3cd29da46deb66801299
|
7
|
+
data.tar.gz: 6eb877f775712cd3fd76788a00151a75608526651044428d5a95a4295b2e21e5fa6ea406492daf6e6f7aa46723ad9c7c2ca02f6c9a95c7cf564b42f297084249
|
data/lib/limits.yaml
CHANGED
@@ -107,3 +107,21 @@
|
|
107
107
|
:minimum_phase_out: 400
|
108
108
|
:catch_up_contribution: 1000
|
109
109
|
:catch_up_age: 50
|
110
|
+
2021:
|
111
|
+
:single:
|
112
|
+
:lower_income_limit: 125000
|
113
|
+
:upper_income_limit: 140000
|
114
|
+
:contribution_limit: 6000
|
115
|
+
:minimum_phase_out: 200
|
116
|
+
:head_of_household:
|
117
|
+
:lower_income_limit: 125000
|
118
|
+
:upper_income_limit: 140000
|
119
|
+
:contribution_limit: 6000
|
120
|
+
:minimum_phase_out: 200
|
121
|
+
:married_filing_jointly:
|
122
|
+
:lower_income_limit: 198000
|
123
|
+
:upper_income_limit: 208000
|
124
|
+
:contribution_limit: 12000
|
125
|
+
:minimum_phase_out: 400
|
126
|
+
:catch_up_contribution: 1000
|
127
|
+
: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, 2021)
|
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.4')
|
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 2021' do
|
14
|
+
expect{RothIRA.new(2022)}.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 2021' do
|
24
|
+
expect{RothIRA.new(2021)}.to_not raise_error
|
25
25
|
end
|
26
26
|
end
|
27
27
|
|
@@ -526,4 +526,69 @@ describe RothIRA do
|
|
526
526
|
end
|
527
527
|
end
|
528
528
|
end
|
529
|
+
|
530
|
+
context 'Tax year 2021' do
|
531
|
+
let(:roth_ira) { RothIRA.new(2021) }
|
532
|
+
context 'Single' do
|
533
|
+
it 'returns maximum contribution for bottom of income limit' do
|
534
|
+
expect(roth_ira.calculate(125000, :single, 40)).to eq(6000)
|
535
|
+
end
|
536
|
+
|
537
|
+
it 'returns maximum contribution for bottom of income limit with catch-up' do
|
538
|
+
expect(roth_ira.calculate(125000, :single, 50)).to eq(7000)
|
539
|
+
end
|
540
|
+
|
541
|
+
it 'returns zero contribution for top of income limit' do
|
542
|
+
expect(roth_ira.calculate(140000, :single, 40)).to eq(0)
|
543
|
+
end
|
544
|
+
|
545
|
+
it 'returns zero contribution for top of income limit with catch-up' do
|
546
|
+
expect(roth_ira.calculate(140000, :single, 50)).to eq(0)
|
547
|
+
end
|
548
|
+
end
|
549
|
+
|
550
|
+
context 'Head of Household' do
|
551
|
+
it 'returns maximum contribution for bottom of income limit' do
|
552
|
+
expect(roth_ira.calculate(125000, :head_of_household, 40)).to eq(6000)
|
553
|
+
end
|
554
|
+
|
555
|
+
it 'returns maximum contribution for bottom of income limit with catch-up' do
|
556
|
+
expect(roth_ira.calculate(125000, :head_of_household, 50)).to eq(7000)
|
557
|
+
end
|
558
|
+
|
559
|
+
it 'returns zero contribution for top of income limit' do
|
560
|
+
expect(roth_ira.calculate(140000, :head_of_household, 40)).to eq(0)
|
561
|
+
end
|
562
|
+
|
563
|
+
it 'returns maximum contribution for bottom of income limit with catch-up' do
|
564
|
+
expect(roth_ira.calculate(140000, :head_of_household, 50)).to eq(0)
|
565
|
+
end
|
566
|
+
end
|
567
|
+
|
568
|
+
context 'Married Filing Jointly' do
|
569
|
+
it 'returns maximum contribution for bottom of income limit' do
|
570
|
+
expect(roth_ira.calculate(198000, :married_filing_jointly, 40, 40)).to eq(12000)
|
571
|
+
end
|
572
|
+
|
573
|
+
it 'returns maximum contribution for bottom of income limit with one catch-up' do
|
574
|
+
expect(roth_ira.calculate(198000, :married_filing_jointly, 40, 50)).to eq(13000)
|
575
|
+
end
|
576
|
+
|
577
|
+
it 'returns maximum contribution for bottom of income limit with both catch-up' do
|
578
|
+
expect(roth_ira.calculate(198000, :married_filing_jointly, 50, 50)).to eq(14000)
|
579
|
+
end
|
580
|
+
|
581
|
+
it 'returns zero contribution for top of income limit' do
|
582
|
+
expect(roth_ira.calculate(208000, :married_filing_jointly, 40, 40)).to eq(0)
|
583
|
+
end
|
584
|
+
|
585
|
+
it 'returns zero contribution for top of income limit with one catch-up' do
|
586
|
+
expect(roth_ira.calculate(208000, :married_filing_jointly, 40, 50)).to eq(0)
|
587
|
+
end
|
588
|
+
|
589
|
+
it 'returns zero contribution for top of income limit with both catch-up' do
|
590
|
+
expect(roth_ira.calculate(208000, :married_filing_jointly, 50, 50)).to eq(0)
|
591
|
+
end
|
592
|
+
end
|
593
|
+
end
|
529
594
|
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.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Randall Reed
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-10-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -56,8 +56,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
56
56
|
- !ruby/object:Gem::Version
|
57
57
|
version: '0'
|
58
58
|
requirements: []
|
59
|
-
|
60
|
-
rubygems_version: 2.6.11
|
59
|
+
rubygems_version: 3.0.3
|
61
60
|
signing_key:
|
62
61
|
specification_version: 4
|
63
62
|
summary: Roth IRA Contribution Limit Calculator
|