rubygems/rubygems — pull request #948 by eregon (2014-06-18 10:46:15+00:00)
Title: Stop defining an empty Date class

* Simply use a matcher: if we have an instance of Date,
Date must be loaded and we can simply use Date#===.
If Date is not defined, then Date is not loaded
and we can not have an instance of Date.
* See https://bugs.ruby-lang.org/issues/9890

I had a simple try at removing the empty Date class in `specification.rb`.
What do you think? @drbrain

I do not know how much compatibility is needed but if 1.8.7 is wanted then we cannot use `Proc#===` so that is why I defined my own `#===` on a new object.
An alternative would be to check the class as a String: `obj.class.name == 'Date' or obj.class.name == 'DateTime'` but it sounds brittle and less secure.