HomePhorge

Stubbing time is risky, better an approximate compare.
d27af929b6a0Unpublished

Unpublished Commit · Learn More

Repository Importing: This repository is still importing.

Description

Stubbing time is risky, better an approximate compare.

This test stubbed time, but didn't catch every possible avenue for creating a
new instance based no the current time of day. This, combined with the
Ruby�1.9.2 runtime moving to support fractional seconds more broadly, led to
two "equal" times that didn't compare as identical.

We really don't care about the exact time, so much as that we update it
appropriately on the object, so an approximate comparison is more robust than
trying to stub out and freeze time.

Signed-off-by: Daniel Pittman <daniel@puppetlabs.com>

Details

Event Timeline

Daniel Pittman <daniel@puppetlabs.com> committed rPUd27af929b6a0: Stubbing time is risky, better an approximate compare. (authored by Daniel Pittman <daniel@puppetlabs.com>).Feb 29 2012, 10:22 PM