datamapper/do — pull request #62 by arthurpsmith (2013-08-28 17:48:29+00:00)
Title: Datestyle needs to be consistent for dataobjects date parsing

Second attempt at this pull request...

I'm not certain this is the right solution. It's necessary for our postgres (actually enterprisedb) configuration, but we may be unusual. Without this fix, when I test against our db instance, I see 18 failing specs, for example:

3) DataObjects::Postgres with Array it should behave like supporting Array passing an Array as a parameter in execute_reader should return correct number of rows
Failure/Error: while(@reader.next!) do
DataObjects::DataError:
Couldn't parse date: 14-FEB-08 00:00:00

Even with this fix, there are still 4 failing specs in our configuration (all of which failed without the fix also; the first two don't appear to be date-related):

1) DataObjects::Postgres::Connection it should behave like a Connection with authentication support with an invalid URI should raise an error with a meaningless URI
Failure/Error: connecting_with("#{@driver}://peekaboo$2!@#4543").should raise_error(Addressable::URI::InvalidURIError)
expected Addressable::URI::InvalidURIError, got #
got: # (using ==)

4) DataObjects::Postgres with Date exotic dates should return the number of created rows
Failure/Error: @values.first.should == Date.civil(1, 1, 1)
expected: #
got: # (using ==)