Sha256: 406ae6041fed85670330d197aa8f849c333732ab6662130c9bc4017e7a9d52ec

Contents?: true

Size: 829 Bytes

Versions: 14

Compression:

Stored size: 829 Bytes

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/migration'
require 'lhm/atomic_switcher'

describe Lhm::AtomicSwitcher do
  include UnitHelper

  before(:each) do
    @start       = Time.now
    @origin      = Lhm::Table.new('origin')
    @destination = Lhm::Table.new('destination')
    @migration   = Lhm::Migration.new(@origin, @destination, @start)
    @switcher    = Lhm::AtomicSwitcher.new(@migration, nil)
  end

  describe 'atomic switch' do
    it 'should perform a single atomic rename' do
      value(@switcher.atomic_switch).must_equal(
        "rename table `origin` to `#{ @migration.archive_name }`, " \
        '`destination` to `origin`'
      )
    end
  end
end

Version data entries

14 entries across 14 versions & 2 rubygems

Version Path
lhm-shopify-4.0.0 spec/unit/atomic_switcher_spec.rb
lhm-teak-3.6.4 spec/unit/atomic_switcher_spec.rb
lhm-teak-3.6.3 spec/unit/atomic_switcher_spec.rb
lhm-teak-3.6.2 spec/unit/atomic_switcher_spec.rb
lhm-teak-3.6.1 spec/unit/atomic_switcher_spec.rb
lhm-teak-3.6.0 spec/unit/atomic_switcher_spec.rb
lhm-shopify-3.5.5 spec/unit/atomic_switcher_spec.rb
lhm-shopify-3.5.4 spec/unit/atomic_switcher_spec.rb
lhm-shopify-3.5.3 spec/unit/atomic_switcher_spec.rb
lhm-shopify-3.5.2 spec/unit/atomic_switcher_spec.rb
lhm-shopify-3.5.0 spec/unit/atomic_switcher_spec.rb
lhm-shopify-3.5.1 spec/unit/atomic_switcher_spec.rb
lhm-shopify-3.4.2 spec/unit/atomic_switcher_spec.rb
lhm-shopify-3.4.1 spec/unit/atomic_switcher_spec.rb