Created
March 1, 2010 02:31
-
-
Save cyx/318028 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe "given today is April fools" do | |
before(:each) { Timecop.freeze Time.utc( 2010, 04, 01 ) } | |
describe Item, "bought yesterday" do | |
subject { Item.new(:when => 'Yesterday') } | |
its(:when) { should == Date.new( 2010, 03, 31 ) } | |
end | |
describe Item, "bought today" do | |
subject { Item.new(:when => 'Today') } | |
its(:when) { should == Date.new( 2010, 04, 01 ) } | |
end | |
describe Item, "bought last friday" do | |
subject { Item.new(:when => "Last friday") } | |
its(:when) { should == Date.new(2010, 03, 26) } | |
end | |
describe Item, "bought this friday" do | |
subject { Item.new(:when => "this friday") } | |
its(:when) { should == Date.new(2010, 04, 02) } | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment