Sha256: 701ab0bb47ddb2cf3ef850c93d010afde4d42069735bea8abeda2831cf395b8a

Contents?: true

Size: 757 Bytes

Versions: 9

Compression:

Stored size: 757 Bytes

Contents

require 'spec_helper'

describe 'CIDR migrations' do
  let!(:connection) { ActiveRecord::Base.connection }
  it 'creates an cidr column' do
    lambda do
      connection.create_table :data_types do |t|
        t.cidr :cidr_1
        t.cidr :cidr_2, :cidr_3
        t.column :cidr_4, :cidr
      end
    end.should_not raise_exception

    columns = connection.columns(:data_types)
    cidr_1 = columns.detect { |c| c.name == 'cidr_1'}
    cidr_2 = columns.detect { |c| c.name == 'cidr_2'}
    cidr_3 = columns.detect { |c| c.name == 'cidr_3'}
    cidr_4 = columns.detect { |c| c.name == 'cidr_4'}

    cidr_1.sql_type.should eq 'cidr'
    cidr_2.sql_type.should eq 'cidr'
    cidr_3.sql_type.should eq 'cidr'
    cidr_4.sql_type.should eq 'cidr'
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
postgres_ext-0.0.9 spec/migrations/cidr_spec.rb
postgres_ext-0.0.8 spec/migrations/cidr_spec.rb
postgres_ext-0.0.7 spec/migrations/cidr_spec.rb
postgres_ext-0.0.6 spec/migrations/cidr_spec.rb
postgres_ext-0.0.5 spec/migrations/cidr_spec.rb
postgres_ext-0.0.4 spec/migrations/cidr_spec.rb
postgres_ext-0.0.3 spec/migrations/cidr_spec.rb
postgres_ext-0.0.2 spec/migrations/cidr_spec.rb
postgres_ext-0.0.1 spec/migrations/cidr_spec.rb