10 September 2010

The Ruby Reflector

Topic

Timecop

  Source Favicon
Email

…times and dates have come a long way, now that Timecop is around. Prior to Timecop, we would use a stubbing library like Mocha to stub out just what we needed, but why do that when Van Damme could beat the right values out of Time ?

The Bomb

I wrote this Cucumber feature, models have been changed to protect the innocent. Scenario: List latest posts under a tag Given the following posts exist: | Post | Tag list | Created on | Expires on | | …

robots.thoughtbot.com Read
  Source Favicon
By terry of terrbear.org 5 months ago.
Email

Timecop

A developer at our office was working with some relative time methods. These are inherently tricky to test, because if "next week" means "next business week", you can't just willy-nilly add 7 days to a day and do tests. Same with "this week", etc.

Instead of doing a bunch of complicated date math that would arguably make the tests just as scary as the code, we found Timecop , which lets you freeze time for your tests. You can say, "I …

terrbear.org Read
  Source Favicon
By John Trupiano of 9 months ago.
Email

Fix bug that would not allow Timecop to be used when Ruby's ‘date'

library had not been previously loaded.

Code contributed by Tuomas Kareinen [ tuomas ]

Fix bug when traveling to a DateTime across a DST boundary that

resulted in DateTime's being off by an hour.

Migrate argument parsing into Timecop:: TimeStackItem to reduce the

responsibility of the Timecop class.

blog.smartlogicsolutions.com Read
  Source Favicon
Email

Suggested using mock objects to test third party sites, mentioned Timecop gem to manipulate time

Mentioned ActionController:: TestProcess#fixture_file_upload which may be useful testing file uploads

Optimizing Perceived Performance by David Eisinger

Unfortunately I missed the introduction to David's presentation and sat in the very back where it was somewhat difficult to hear. David advocated for UI snappiness to improve user experience. He used jQuery to load and display …

blog.webandy.com Read