Advertisement
saasbook

date_calculator_spec.rb

Jan 10th, 2012
199
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.46 KB | None | 0 0
  1. require 'date_calculator'
  2. describe DateCalculator do
  3.   before :each do
  4.     @years_calculator = DateCalculator.new(origin = 1970)
  5.   end
  6.   it "returns the origin year if fewer than 365 days have passed" do
  7.     @years_calculator.current_year_from_days(364).should == 1970
  8.   end
  9.   it "returns 1 more than origin if 400 days have passed" do
  10.     @years_calculator.current_year_from_days(400).should == 1971
  11.   end
  12.   it "returns 3 more than origin if 900 days have passed"
  13. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement