Sha256: e897a29f0506531b2d83b5d0befee8fc45d7d80b832670de12f10a5dbfa40512

Contents?: true

Size: 1.09 KB

Versions: 4

Compression:

Stored size: 1.09 KB

Contents

require 'physique'

describe Physique::FluentMigratorConfig do

  it 'should throw when config is missing required values' do
    %w(instance= name= project= lang= scripts_dir=).each do |p|
      expect {
        default_config do |c|
          c.send p, nil
        end
      }.to raise_error(ArgumentError)
    end
  end

  it 'should default to the cs programming language' do
    project_name = 'Test.Database'
    opts = default_config do |c|
      c.project = 'Test.Database'
    end
    expect(opts.project_file).to eq("src/#{project_name}/#{project_name}.csproj")
  end

  it 'should find full project path when specifying the name and language' do
    project_name = 'Test.Database'
    opts = default_config do |c|
      c.lang = :vb
    end

    expect(opts.project_file).to eq("src/#{project_name}/#{project_name}.vbproj")
  end

  def default_config
    config = Physique::FluentMigratorConfig.new.tap do |c|
      c.instance = '(local)'
      c.name = 'TestDatabase'
      c.project = 'Test.Database'

      yield c if block_given?
    end
    config.opts
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
physique-0.3.4 spec/fluent_migrator_config_spec.rb
physique-0.3.3 spec/fluent_migrator_config_spec.rb
physique-0.3.2 spec/fluent_migrator_config_spec.rb
physique-0.3.1 spec/fluent_migrator_config_spec.rb