Sha256: eb1a8f7c091f3793dcfc249edd35acf1756988394ee8b508c220abdf002c329c

Contents?: true

Size: 917 Bytes

Versions: 40

Compression:

Stored size: 917 Bytes

Contents

# encoding: utf-8

require File.expand_path(File.join(File.dirname(__FILE__), '..', 'spec_helper'))
require 'data_objects/spec/shared/typecast/date_spec'

describe 'DataObjects::Postgres with Date' do
  it_should_behave_like 'supporting Date'
  it_should_behave_like 'supporting Date autocasting'

  describe 'exotic dates' do

    before do
      @connection = DataObjects::Connection.new(CONFIG.uri)
      @connection.create_command("INSERT INTO widgets (release_date) VALUES ('0001-01-01')").execute_non_query

      @command = @connection.create_command("SELECT release_date FROM widgets WHERE release_date = '0001-01-01'")
      @reader = @command.execute_reader
      @reader.next!
      @values = @reader.values
    end

    after do
      @reader.close
      @connection.close
    end

    it 'should return the number of created rows' do
      @values.first.should == Date.civil(1, 1, 1)
    end

  end

end

Version data entries

40 entries across 40 versions & 1 rubygems

Version Path
do_postgres-0.10.17 spec/typecast/date_spec.rb
do_postgres-0.10.17-x86-mswin32-60 spec/typecast/date_spec.rb
do_postgres-0.10.17-x86-mingw32 spec/typecast/date_spec.rb
do_postgres-0.10.17-java spec/typecast/date_spec.rb
do_postgres-0.10.16 spec/typecast/date_spec.rb
do_postgres-0.10.16-x86-mswin32-60 spec/typecast/date_spec.rb
do_postgres-0.10.16-x86-mingw32 spec/typecast/date_spec.rb
do_postgres-0.10.16-java spec/typecast/date_spec.rb
do_postgres-0.10.15 spec/typecast/date_spec.rb
do_postgres-0.10.15-x86-mswin32-60 spec/typecast/date_spec.rb
do_postgres-0.10.15-x86-mingw32 spec/typecast/date_spec.rb
do_postgres-0.10.15-java spec/typecast/date_spec.rb
do_postgres-0.10.14 spec/typecast/date_spec.rb
do_postgres-0.10.14-x86-mswin32-60 spec/typecast/date_spec.rb
do_postgres-0.10.14-x86-mingw32 spec/typecast/date_spec.rb
do_postgres-0.10.14-java spec/typecast/date_spec.rb
do_postgres-0.10.13 spec/typecast/date_spec.rb
do_postgres-0.10.13-x86-mswin32-60 spec/typecast/date_spec.rb
do_postgres-0.10.13-x86-mingw32 spec/typecast/date_spec.rb
do_postgres-0.10.13-java spec/typecast/date_spec.rb