Sha256: 848599b7ba48f432bc33b3c8d7713da92d580d9dddc03a5a44c705fae4eaafe8

Contents?: true

Size: 994 Bytes

Versions: 36

Compression:

Stored size: 994 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::Mysql with Date' do
  it_should_behave_like 'supporting Date'
  it_should_behave_like 'supporting Date autocasting'

  describe 'reading 0000-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_date) VALUES ('')").execute_non_query

      @command = @connection.create_command("SELECT release_date FROM widgets WHERE release_date = '0000-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.12 spec/typecast/date_spec.rb
do_mysql-0.10.12-x86-mswin32-60 spec/typecast/date_spec.rb
do_mysql-0.10.12-x86-mingw32 spec/typecast/date_spec.rb
do_mysql-0.10.12-java spec/typecast/date_spec.rb
do_mysql-0.10.11 spec/typecast/date_spec.rb
do_mysql-0.10.11-x86-mswin32-60 spec/typecast/date_spec.rb
do_mysql-0.10.11-x86-mingw32 spec/typecast/date_spec.rb
do_mysql-0.10.11-java spec/typecast/date_spec.rb
do_mysql-0.10.10 spec/typecast/date_spec.rb
do_mysql-0.10.10-x86-mswin32-60 spec/typecast/date_spec.rb
do_mysql-0.10.10-x86-mingw32 spec/typecast/date_spec.rb
do_mysql-0.10.10-java spec/typecast/date_spec.rb
do_mysql-0.10.9 spec/typecast/date_spec.rb
do_mysql-0.10.9-x86-mswin32-60 spec/typecast/date_spec.rb
do_mysql-0.10.9-x86-mingw32 spec/typecast/date_spec.rb
do_mysql-0.10.9-java spec/typecast/date_spec.rb