Sha256: 61291cc3037d2473391ae29fd99e5fc0a2f2836f1c471c69c86d76e5554de5c3

Contents?: true

Size: 1.05 KB

Versions: 9

Compression:

Stored size: 1.05 KB

Contents

# Copyright (c) 2011, SoundCloud Ltd., Rany Keddo, Tobias Bielohlawek, Tobias
# Schmidt

require File.expand_path(File.dirname(__FILE__)) + '/unit_helper'

require 'lhm/table'
require 'lhm/migrator'

describe Lhm::Intersection do
  include UnitHelper

  it "should not have dropped changes" do
    origin = Lhm::Table.new("origin")
    origin.columns["dropped"]  = varchar
    origin.columns["retained"] = varchar

    destination = Lhm::Table.new("destination")
    destination.columns["retained"] = varchar

    intersection = Lhm::Intersection.new(origin, destination)
    intersection.common.include?("dropped").must_equal(false)
  end

  it "should have unchanged columns" do
    origin = Lhm::Table.new("origin")
    origin.columns["dropped"]  = varchar
    origin.columns["retained"] = varchar

    destination = Lhm::Table.new("destination")
    destination.columns["retained"] = varchar

    intersection = Lhm::Intersection.new(origin, destination)
    intersection.common.must_equal(["retained"])
  end

  def varchar
    { :metadata => "VARCHAR(255)"}
  end
end

Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
sbader-lhm-1.1.0 spec/unit/intersection_spec.rb
lhm-1.1.0 spec/unit/intersection_spec.rb
lhm-1.0.3 spec/unit/intersection_spec.rb
lhm-1.0.2 spec/unit/intersection_spec.rb
lhm-1.0.0.rc7 spec/unit/intersection_spec.rb
lhm-1.0.0.rc6 spec/unit/intersection_spec.rb
lhm-1.0.0.rc5 spec/unit/intersection_spec.rb
lhm-1.0.0.rc4 spec/unit/intersection_spec.rb
lhm-1.0.0.rc3 spec/unit/intersection_spec.rb