-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug? Looks like Rails internal time calculation DSL gets fucked up!? #11
Comments
Could you gist in the failure message? Although I'm not surprised. Time-lord handles time math a lot differently The best I can do is make sure all interfaces are covered so you're Alternatively you can require: false in your Gemfile and only require parts On Fri, Mar 29, 2013 at 5:06 AM, Kristian Mandrup
Kurtis Rainbolt-Greene, Hacker |
Here are some... require 'spec_helper'
# without this, the tests below pass just fine
require 'time-lord'
# To test and make sure that none of the included gems or any core extensions of this gem fuck up the
# normal date calculation/comparison etc functionality of Ruby and Rails ;)
describe 'Ensure system Time calculations still operate as the should!' do
it 'should add Time + Time normally' do
expect(1.days + 3.days).to eq 4.days
end
it 'should add Date + Time normally' do
expect(Date.today + 3.days).to eq 3.days.from_now.to_date
end
end Removing the it 'should add Date + Time normally' do
expect(Date.today + 3.days).to eq 3.days.from_now
end Ensure system Time calculations still operate as the should! should add Date + Time normally
Failure/Error: expect(Date.today + 3.days).to eq 3.days.from_now
expected: #<TimeLord::Period:0x007f91b08890c0 @beginning=2013-04-01 20:14:08 +0200, @ending=2013-03-29 19:14:08 +0100>
got: Tue, 28 Nov 2722
(compared using ==)
Diff:
@@ -1,4 +1,2 @@
-#<TimeLord::Period:0x007f91b08890c0
- @beginning=2013-04-01 20:14:08 +0200,
- @ending=2013-03-29 19:14:08 +0100>
+Tue, 28 Nov 2722 Oops! Calculation about 710 years wrong!!! I think the problem is either the Would be nice if you could at least make these two scenarios pass ;) Thanks! |
I have written the
timespan
gem. After includingtime-lord
weird things started to happen.kristianmandrup/timespan#2
Then I wrote this test:
Removed
time-lord
, and then the tests passed again. You should look into this ;)The text was updated successfully, but these errors were encountered: