I''m having a helluva time getting Date.today.utc to resolve - "undefined method `utc'' for #<Date: 4908343/2,0,2299161>" model usage in before_create filter is : activated_at = Date.today.utc I''m not stubbing out Date (should I be? [ stub(Date, :utc => Date.today) didn''t help any ]. The before filter is working fine within the app, but rspec isn''t happy. Should I include something particular? Thanx for any help. Jodi -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/rspec-users/attachments/20070312/db154032/attachment.html
On 3/12/07, Jodi Showers <jodi at nnovation.ca> wrote:> I''m having a helluva time getting Date.today.utc to resolve - > > "undefined method `utc'' for #<Date: 4908343/2,0,2299161>" > > model usage in before_create filter is : > > activated_at = Date.today.utc >I''m not sure why you think this is RSpec related. Check the RDocs for Date - it has no utc method (but Time does). Aslak> I''m not stubbing out Date (should I be? [ stub(Date, :utc => Date.today) > didn''t help any ]. > > The before filter is working fine within the app, but rspec isn''t happy. > Should I include something particular? > > Thanx for any help. > > > > Jodi > > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >
On 12-Mar-07, at 3:52 PM, aslak hellesoy wrote:> On 3/12/07, Jodi Showers <jodi at nnovation.ca> wrote: >> I''m having a helluva time getting Date.today.utc to resolve - >> >> "undefined method `utc'' for #<Date: 4908343/2,0,2299161>" >> >> model usage in before_create filter is : >> >> activated_at = Date.today.utc >> > > I''m not sure why you think this is RSpec related. > > Check the RDocs for Date - it has no utc method (but Time does). > > Aslakmea culpa I thought my before_filter was succeeding, and rspec wasn''t seeing a lib - or Date was being mocked by rspec. turns out the simple answer was the before_filter wasn''t working. 8-> thanx Aslak. Jodi