Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Tim's Methods
require 'rspec'
require 'date'
describe "Tim's Methods" do
it "should be clear that Tim needs to get his ass back here" do
do_we_want_tim_back = TimsRep.new.do_we_like_him?
do_we_want_tim_back.should == true
end
end
class TimsRep
attr_accessor :days_gone
def initialize
@days_gone = Date.today - Date.commercial(2011,27,4)
end
def do_we_like_him?
do_we_remember_who_he_is?
end
def do_we_remember_who_he_is?
days_gone < 40 ? true : false
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment