
date_calculator_spec_5.rb
By:
saasbook 
on
May 1st, 2012 | syntax:
Ruby | size: 0.68 KB | hits: 55 | expires: Never
require 'date_calculator'
describe DateCalculator do
it "returns the origin year if fewer than 365 days have passed" do
years_calculator = DateCalculator.new(origin = 1970)
years_calculator.current_year_from_days(364).should == 1970
end
context "when origin year is a regular year" do
it "returns one greater than origin year if 366 days have passed" do
years_calculator = DateCalculator.new(1980)
years_calculator.current_year_from_days(366).should == 1981
end
end
context "when origin year is a leap year" do
it "returns the origin year if 366 days have passed"
it "returns one greater than origin year if more than 366 days have passed"
end
end