roth_ira 1.2.2 → 1.2.3

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
- SHA256:
3
- metadata.gz: 3b4d9573d6efb1ff7aad5b46461054344c6342f1fa18c691841028864b747195
4
- data.tar.gz: 48cabe6645d77f44bf21fb1e4c7db03221da2bd6f299cb5d1e20cb4bd3540ee7
2
+ SHA1:
3
+ metadata.gz: f260eb623b70f60674f2a8f5caa08998cf2cb72e
4
+ data.tar.gz: 68ec414d0b99e74e0d2ef9d84ced6392997f0447
5
5
  SHA512:
6
- metadata.gz: 100d3e11c09f6692361a64c58c350dc46f63e6de946c014e184d088795d0131c42b097f4a67e181101611a5f83ed1a668e53b53a8554a4f3ec69650e81c8dd35
7
- data.tar.gz: 0bfc00ffc4b1b02c0c0d0ea1557c0b791185a053f39d1fa99201a1acb5ebba3f3484bce7f7893e8d0c8abbcf5ed9ba3981e5c6a79004623d337e16138fead47b
6
+ metadata.gz: e40e7675b9f4f2f98e51fa91ba1c035fa19ac39f7db245f6b84ef13b1f70f722ab3719bd5d942870564d435bb21eb4008c9820c195653420b673fdec4ee231c7
7
+ data.tar.gz: a9207765334c015c69963f37bd5a2256282972e8b25522a6cf2f8af88d06e8876cedbe93145eb9f5f2b0621763908a65276239dc8d21a4fa1b28b6220fc8582c
@@ -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
@@ -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, 2019)
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
@@ -1,3 +1,3 @@
1
1
  class RothIRA
2
- VERSION = '1.2.2'
2
+ VERSION = '1.2.3'
3
3
  end
@@ -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.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 2019' do
14
- expect{RothIRA.new(2020)}.to raise_error ArgumentError
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 2019' do
24
- expect{RothIRA.new(2019)}.to_not raise_error
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.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: 2018-10-17 00:00:00.000000000 Z
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.7.7
60
+ rubygems_version: 2.6.11
61
61
  signing_key:
62
62
  specification_version: 4
63
63
  summary: Roth IRA Contribution Limit Calculator