Sha256: 6ebcca8e9bb4f21893d1a19da6d1b484b0f1851b6dba145a7e583f0648712c25

Contents?: true

Size: 789 Bytes

Versions: 3

Compression:

Stored size: 789 Bytes

Contents

require File.dirname(__FILE__) + "/spec_helper"

describe DataMapper::Adapters::Sql::Mappings::Column do
  
  it "should be unique within a set" do
    
    mappings = DataMapper::Adapters::Sql::Mappings
    
    columns = SortedSet.new

    columns << mappings::Column.new(database(:mock).adapter, nil, :one, :string, 1)
    columns << mappings::Column.new(database(:mock).adapter, nil, :two, :string, 2)
    columns << mappings::Column.new(database(:mock).adapter, nil, :three, :string, 3)
    columns.should have(3).entries
    
    columns << mappings::Column.new(database(:mock).adapter, nil, :two, :integer, 3)
    columns.should have(3).entries
    
    columns << mappings::Column.new(database(:mock).adapter, nil, :id, :integer, -1)
    columns.should have(4).entries
  end
  
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
datamapper-0.2.1 spec/column_spec.rb
datamapper-0.2.2 spec/column_spec.rb
datamapper-0.2.3 spec/column_spec.rb