Hi guys,
I'd love to get some feedback on a spec I'm writing. It's a tax calculator
for australian taxation rates - nothing too complex just yet, but some of
the calulation specs feel wrong, but I don't know a better way.
Thanks in advance.
describe TaxCalculator do
describe "low income bracket" {
before { subject.income = 5000 }
it { subject.calculate.should == 0 }
}
describe "15c tax bracket" {
before { subject.income = 10000 }
it { subject.calculate.should == 4000 * 0.15 } # the tax bracket is 15c
in the dollar between 6000 and 37000
}
describe "30c tax bracket" {
before { subject.income = 50000 }
it { subject.calculate.should == 6000 * 0 + 31000 * 0.15 + 13000 * 0.30
} # the tax bracket is 30c in the dollar between 37000 and 80000
}
end
Cheers,
Michael
--
Checkout my new website: http://myachinghead.net
http://wakeless.net
--
You received this message because you are subscribed to the Google Groups "Ruby
or Rails Oceania" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/rails-oceania?hl=en.