Skip to content

Commit

Permalink
ignore ArgumentError in this test
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike Dirolf committed Sep 16, 2009
1 parent d95971b commit 4fec23f
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions test/test_bson.rb
Original file line number Diff line number Diff line change
Expand Up @@ -125,11 +125,18 @@ def test_date_returns_as_utc
end

def test_date_before_epoch
doc = {'date' => Time.utc(1600)}
@b.serialize(doc)
doc2 = @b.deserialize
# Mongo only stores up to the millisecond
assert_in_delta doc['date'], doc2['date'], 0.001
begin
doc = {'date' => Time.utc(1600)}
@b.serialize(doc)
doc2 = @b.deserialize
# Mongo only stores up to the millisecond
assert_in_delta doc['date'], doc2['date'], 0.001
rescue ArgumentError
# some versions of Ruby won't let you create pre-epoch Time instances
#
# TODO figure out how that will work if somebady has saved data
# w/ early dates already and is just querying for it.
end
end

def test_dbref
Expand Down

0 comments on commit 4fec23f

Please sign in to comment.