Sha256: a45362659a256cb6adc67b80be0fcf4128a49515731969994069036c3a8a0d86

Contents?: true

Size: 573 Bytes

Versions: 20

Compression:

Stored size: 573 Bytes

Contents

require 'spec_helper'

describe SQL::Table do
  before do
    @table = SQL::Table.new
  end

  %w{name columns}.each do |meth|
    it "should have a ##{meth} attribute" do
      @table.should respond_to(meth.intern)
    end
  end

  it 'should #to_s as the name' do
    @table.name = "table_name"
    @table.to_s.should == "table_name"
  end

  it 'should find a column by name' do
    column_a = mock('column', :name => 'id')
    column_b = mock('column', :name => 'login')
    @table.columns = [column_a, column_b]

    @table.column('id').should == column_a
  end


end

Version data entries

20 entries across 20 versions & 3 rubygems

Version Path
ardm-migrations-1.3.0 spec/unit/sql/table_spec.rb
ardm-migrations-1.2.1 spec/unit/sql/table_spec.rb
ardm-migrations-1.2.0 spec/unit/sql/table_spec.rb
dm-migrations-1.2.0 spec/unit/sql/table_spec.rb
dm-migrations-1.2.0.rc2 spec/unit/sql/table_spec.rb
dm-migrations-1.2.0.rc1 spec/unit/sql/table_spec.rb
dm-migrations-1.1.0 spec/unit/sql/table_spec.rb
dm-migrations-1.1.0.rc3 spec/unit/sql/table_spec.rb
dm-migrations-1.1.0.rc2 spec/unit/sql/table_spec.rb
dm-migrations-1.1.0.rc1 spec/unit/sql/table_spec.rb
dm-migrations-1.0.2 spec/unit/sql/table_spec.rb
dm-migrations-1.0.1 spec/unit/sql/table_spec.rb
dm-hibernate-migrations-1.0.0 spec/unit/sql/table_spec.rb
dm-migrations-1.0.0 spec/unit/sql/table_spec.rb
dm-migrations-1.0.0.rc3 spec/unit/sql/table_spec.rb
dm-migrations-1.0.0.rc2 spec/unit/sql/table_spec.rb
dm-migrations-1.0.0.rc1 spec/unit/sql/table_spec.rb
dm-migrations-0.10.2 spec/unit/sql/table_spec.rb
dm-migrations-0.10.1 spec/unit/sql/table_spec.rb
dm-migrations-0.10.0 spec/unit/sql/table_spec.rb