Skip to content

Instantly share code, notes, and snippets.

@jasonroelofs
Created January 24, 2012 20:57
Show Gist options
  • Save jasonroelofs/1672565 to your computer and use it in GitHub Desktop.
Save jasonroelofs/1672565 to your computer and use it in GitHub Desktop.
Why write two lines of code when you can write 30!
class Clock
def self.now
Time.now
end
def self.today
Date.today
end
end
require 'spec_helper'
describe Clock do
describe ".now" do
it 'returns the current time' do
Clock.now.should be_close(Time.now, 0.01)
end
end
describe ".todqy" do
it 'returns Date.today' do
Clock.today.should == Date.today
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment