Sha256: a8d5647d2ac55fb53ce092152ed86cdc83c007d016297ff5c89ff9beaf5b5828

Contents?: true

Size: 749 Bytes

Versions: 4

Compression:

Stored size: 749 Bytes

Contents

require 'spec_helper'

describe ROM::SQL::Migration do
  let(:migration) { ROM::SQL::Migration }

  context '#run' do
    it 'calls Sequel migration code' do
      migration.path = 'foo/bar'
      migration.connection = double
      opts = { foo: 'bar' }

      expect(Sequel::Migrator).to receive(:run)
        .with(migration.connection, migration.path, opts)

      migration.run(opts)
    end
  end

  context '#path' do
    it 'returns default path if non provided' do
      migration.path = nil

      expect(migration.path).to eq ROM::SQL::Migration::DEFAULT_PATH
    end
  end

  context '.create' do
    it 'calls Sequel migration block' do
      expect(Sequel).to receive(:migration)

      ROM::SQL::Migration.create {}
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
rom-sql-0.4.0 spec/unit/migration_spec.rb
rom-sql-0.4.0.rc1 spec/unit/migration_spec.rb
rom-sql-0.4.0.beta2 spec/unit/migration_spec.rb
rom-sql-0.4.0.beta1 spec/unit/migration_spec.rb