Sha256: 266646d8eb24add97b96998b1fa64e0ced13b29c34882c58f00a6d4827521c57

Contents?: true

Size: 1.02 KB

Versions: 36

Compression:

Stored size: 1.02 KB

Contents

# encoding: utf-8

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

describe 'DataObjects::Mysql with DateTime' do
  it_should_behave_like 'supporting DateTime'
  it_should_behave_like 'supporting DateTime autocasting'

  describe 'reading 0000-00-00 00:00:00' do

    before do
      @connection = DataObjects::Connection.new(CONFIG.uri)

      @connection.create_command("SET SESSION sql_mode = 'ALLOW_INVALID_DATES'").execute_non_query
      @connection.create_command("INSERT INTO widgets (release_datetime) VALUES ('')").execute_non_query

      @command = @connection.create_command("SELECT release_datetime FROM widgets WHERE release_datetime = '0000-00-00 00:00:00'")
      @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 be_nil
    end

  end

end

Version data entries

36 entries across 36 versions & 1 rubygems

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