Created
September 2, 2011 04:23
-
-
Save mikel/1187915 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe TaxCalculator do | |
context "low income bracket" do | |
it "should be zero cents in the dollar for income less than 6000" do | |
[-200, 0, 3000, 5999.99].each do |income_level| | |
subject.income = income_level | |
subject.should == 0 | |
end | |
end | |
it "should not be zero cents in the dollar for a 6000 income" do | |
subject.income = 6000 | |
subject.should > 0 | |
end | |
end | |
context "15c income tax bracket" do | |
it "should bill 15c in the dollar for income between 6000 and 37000" do | |
[6000, 10000, 36999.99].each do |income_level| | |
subject.income = income_level | |
subject.should == (income_level * 0.15) | |
end | |
end | |
end | |
context "30c income tax bracket" do | |
it "should bill 30c in the dollar for income between 37000 and 80000" do | |
[37000, 50000, 79999.99].each do |income_level| | |
subject.income = income_level | |
subject.should == (income_level * 0.15) | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment