Sha256: 1271bb2796163158b82110f9721a529feb09c3a001ee1b4d1781c796099c7e69

Contents?: true

Size: 1.06 KB

Versions: 4

Compression:

Stored size: 1.06 KB

Contents

# Copyright (c) 2011 - 2013, 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

4 entries across 4 versions & 1 rubygems

Version Path
lhm-2.1.0 spec/unit/intersection_spec.rb
lhm-2.0.0 spec/unit/intersection_spec.rb
lhm-1.3.0 spec/unit/intersection_spec.rb
lhm-1.2.0 spec/unit/intersection_spec.rb