Re: [rspec-users] Odd Date-based spec failing

2008-07-03 Thread Matt Darby
Can you try these and tell us which ones pass and which ones fail? rake spec rake spec:models script/spec spec script/spec spec/models script/spec spec/models -r script/spec spec/models/phase_spec.rb script/spec spec/models/phase_spec.rb -r ruby spec/models/phase_spec.rb ruby spec/models/phase_sp

Re: [rspec-users] Odd Date-based spec failing

2008-07-03 Thread David Chelimsky
On Jun 30, 2008, at 9:43 PM, Matt Darby wrote: On Jul 1, 2008, at 10:10 PM, Camilo Torres wrote: It seems your Phase.percentage_complete is not working as you expect. It clearly returns 100 when you are specting 83. The test clearly said that. ¿What is the implementation of your percentage

Re: [rspec-users] Odd Date-based spec failing

2008-07-03 Thread Matt Darby
Yeah - use the debugger (ruby-debug) and the failing test case: it "should have 5.days as the proper fixnum" do require 'rubygems'; require 'ruby-debug'; debugger 5.days.to_i.should == 5.days end Thanks for the reply, but what does this resolve? It seems as this would be a bug upsteam, no? __

Re: [rspec-users] Odd Date-based spec failing

2008-07-03 Thread Scott Taylor
On Jul 3, 2008, at 8:27 AM, Matt Darby wrote: On Jul 1, 11:21 am, Matt Darby <[EMAIL PROTECTED]> wrote: On Jul 1, 2008, at 8:23 AM, Tom Stuart wrote: $ ./script/console Date.today.minus_with_duration(5.days) => Thu, 26 Jun 2008 Date.today.minus_without_duration(5.days.to_i) => Sun, 17 Se

Re: [rspec-users] Odd Date-based spec failing

2008-07-03 Thread Matt Darby
On Jul 1, 11:21 am, Matt Darby <[EMAIL PROTECTED]> wrote: > On Jul 1, 2008, at 8:23 AM, Tom Stuart wrote: > > > $ ./script/console > > >> Date.today.minus_with_duration(5.days) > > => Thu, 26 Jun 2008 > > >> Date.today.minus_without_duration(5.days.to_i) > > => Sun, 17 Sep 0825 > > > Is this a load

Re: [rspec-users] Odd Date-based spec failing

2008-07-01 Thread Matt Darby
On Jul 1, 2008, at 8:23 AM, Tom Stuart wrote: $ ./script/console >> Date.today.minus_with_duration(5.days) => Thu, 26 Jun 2008 >> Date.today.minus_without_duration(5.days.to_i) => Sun, 17 Sep 0825 Is this a load-order problem? Perhaps ActiveSupport::CoreExtensions::Date::Calculations isn't kic

Re: [rspec-users] Odd Date-based spec failing

2008-07-01 Thread Tom Stuart
On 1 Jul 2008, at 13:06, Matt Darby wrote: When run via 'rake spec:models' Date.today = 2008-07-01 self.start_date = 0825-09-17 self.end_date = 2008-07-02 Pretty obvious what the bug is suddenly, but would cause this? Not a solution, but a clue: $ ./script/console >> Date.today.minus_with_dur

Re: [rspec-users] Odd Date-based spec failing

2008-07-01 Thread Matt Darby
On Jul 1, 2008, at 2:10 AM, Pat Maddox wrote: What do you see when you puts the values of end_date, start_date, and Date.today inside of #percentage_complete? When run via TextMate/Rspec Bundle: Date.today = 2008-07-01 self.start_date = 2008-06-26 self.end_date = 2008-07-02 When run via 'rak

Re: [rspec-users] Odd Date-based spec failing

2008-06-30 Thread Pat Maddox
What do you see when you puts the values of end_date, start_date, and Date.today inside of #percentage_complete? On Mon, Jun 30, 2008 at 7:43 PM, Matt Darby <[EMAIL PROTECTED]> wrote: > On Jul 1, 2008, at 10:10 PM, Camilo Torres wrote: > >> It seems your Phase.percentage_complete is not working as

Re: [rspec-users] Odd Date-based spec failing

2008-06-30 Thread Matt Darby
On Jul 1, 2008, at 10:10 PM, Camilo Torres wrote: It seems your Phase.percentage_complete is not working as you expect. It clearly returns 100 when you are specting 83. The test clearly said that. ¿What is the implementation of your percentage_complete method? It only fails when run via 'rake

Re: [rspec-users] Odd Date-based spec failing

2008-06-30 Thread Camilo Torres
It seems your Phase.percentage_complete is not working as you expect. It clearly returns 100 when you are specting 83. The test clearly said that. ¿What is the implementation of your percentage_complete method? 2008/7/1 Matt Darby <[EMAIL PROTECTED]>: > Hrm. > > I have a spec for a model 'Phase'.

[rspec-users] Odd Date-based spec failing

2008-06-30 Thread Matt Darby
Hrm. I have a spec for a model 'Phase'. a Phase has a start and end date, and a method 'percentage_complete' that calculates the percentage of time that has already elapsed between said start and end dates. This spec passes as expected: module PhaseHelper def valid_attributes {