`DateTime` is not defined unless you have required the date library:

``` irb
➜  rspec-mocks git:(add-deprecations-for-519-to-2-99) ✗ irb
irb(main):001:0> Time
=> Time
irb(main):002:0> DateTime
NameError: uninitialized constant DateTime
	from (irb):2
	from /Users/myron/.rubies/ruby-2.0.0-p247/bin/irb:12:in `<main>'
irb(main):003:0> require 'date'
=> true
irb(main):004:0> DateTime
=> DateTime
```

So, I think this needs to be an if statement:

``` ruby
if Time === object
  format_time(object)
elsif defined?(DateTime) && DateTime === object
  format_date_time(object)
else
  object.inspect
end
```