Sha256: f5973909d5be973e34bf76a9c7952cbdd304b49cf6985ded4fabcdc87eaa9e66

Contents?: true

Size: 958 Bytes

Versions: 64

Compression:

Stored size: 958 Bytes

Contents

# encoding: utf-8

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

describe DataObjects::Mysql::Reader do
  it_should_behave_like 'a Reader'

  describe 'reading database metadata' do

    subject { reader }

    let(:connection) { DataObjects::Connection.new(CONFIG.uri) }
    let(:command)    { connection.create_command(sql) }
    let(:reader)     { command.execute_reader }

    after do
      reader.close
      connection.close
    end

    describe 'showing correct column field names for a table' do
      let(:sql)     { 'SHOW COLUMNS FROM `widgets`' }
      its(:fields)  { should == [ "Field", "Type", "Null", "Key", "Default", "Extra" ] }
    end

    describe 'showing correct column field names for variables' do
      let(:sql)     { "SHOW VARIABLES LIKE 'character_set_connection'" }
      its(:fields)  { should == [ 'Variable_name', 'Value' ] }
    end

  end

end

Version data entries

64 entries across 64 versions & 1 rubygems

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