Sha256: 59f0a793b974002a47dcae3c20ea4b2115c76b438aeabb1db5c44251f0d2f36f
Contents?: true
Size: 1.27 KB
Versions: 13
Compression:
Stored size: 1.27 KB
Contents
# Copyright (c) 2011 - 2013, SoundCloud Ltd., Rany Keddo, Tobias Bielohlawek, Tobias # Schmidt require File.expand_path(File.dirname(__FILE__)) + '/integration_helper' require 'lhm/table' require 'lhm/migration' require 'lhm/locked_switcher' describe Lhm::LockedSwitcher do include IntegrationHelper before(:each) do connect_master! @old_logger = Lhm.logger Lhm.logger = Logger.new('/dev/null') end after(:each) do Lhm.logger = @old_logger end describe 'switching' do before(:each) do @origin = table_create('origin') @destination = table_create('destination') @migration = Lhm::Migration.new(@origin, @destination) end it 'rename origin to archive' do switcher = Lhm::LockedSwitcher.new(@migration, connection) switcher.run slave do value(data_source_exists?(@origin)).must_equal true value(table_read(@migration.archive_name).columns.keys).must_include 'origin' end end it 'rename destination to origin' do switcher = Lhm::LockedSwitcher.new(@migration, connection) switcher.run slave do value(data_source_exists?(@destination)).must_equal false value(table_read(@origin.name).columns.keys).must_include 'destination' end end end end
Version data entries
13 entries across 13 versions & 2 rubygems