May 21
Running the tests, 1 failure. Doesn’t look like a failure to me
Investigating…
1) Failure:
test_new_articles(AnnounceArticleFunctionalTest)
[test/functional/announce_article_test.rb:74:in `test_new_articles'
/usr/lib/ruby/gems/1.8/gems/mocha-0.5.6/lib/mocha/test_case_adapter.rb:19:in `__send__'
/usr/lib/ruby/gems/1.8/gems/mocha-0.5.6/lib/mocha/test_case_adapter.rb:19:in `run']:
<Wed, 21 May 2008 15:12:50 +0000> expected but was
<Wed, 21 May 2008 15:12:50 +0000>.
May 21st, 2008 at 4:02 pm
Of course it is! The problem is that the displayed precision is different from the one used to do the comparison. In this case, you can compare using (Time.now - expected_time) < 1, or use a block to set Time.now to return canned values. Hope that helps!
May 21st, 2008 at 5:25 pm
I’ve run into this before, and ended up rendering the dates to a string and then comparing them.
Weird…
May 21st, 2008 at 5:35 pm
That’s the first thing we thought it was, but it turned out to be the way we were doing the comparison.
It was not a big problem, but the output seemed funny enough to post here