Sha256: 0e03e5ca336e69fdfbe64b70270765ab1cf6ff12c49755c2ddf9d039d1886907

Contents?: true

Size: 1.87 KB

Versions: 4

Compression:

Stored size: 1.87 KB

Contents

# encoding: utf-8

require 'spec_helper'
require 'shared_contexts'
require 'support/sh_interceptor'
require 'albacore'
require 'albacore/task_types/sql_package'

describe 'build config' do
  subject do
    Albacore::SqlPackage::Config.new
  end

  describe 'when setting #action' do
    it 'should be set to a string' do
      subject.action = 'Publish'
      expect(subject.action).to be_a String
    end
  end

  describe 'when setting #sql_package' do
    it 'should be set to a string' do
      subject.sql_package = 'testdata/test.dacpac'
      expect(subject.sql_package).to be_a String
    end
  end

  describe 'when setting #profile' do
    it 'should be set to a string' do
      subject.profile = '.'
      expect(subject.profile).to be_a String
    end
  end

   describe 'when setting #verify_deployment' do
     it 'should be set to a Set' do
       subject.verify_deployment
       expect(subject.verify_deployment).to be_a Set
     end
   end

   describe 'when setting #be_quiet' do
     it 'should be set to a Set' do
       subject.be_quiet
       expect(subject.be_quiet).to be_a Set
     end
   end
end

describe 'when running with sql' do
  let :cfg do
    Albacore::SqlPackage::Config.new
  end

  include_context 'path testing'

  let(:cmd) do
    cmd = Albacore::SqlPackage::Cmd.new cfg.work_dir, 'SqlPackage', cfg.parameters
    cmd.extend ShInterceptor
  end

  before do
    cfg.action = 'Publish'
    cfg.sql_package = 'testdata/test.dacpac'
    cfg.profile = 'testdata/test.publish'
    cfg.verify_deployment
    cfg.be_quiet
    cmd.execute
  end

  subject do
    cmd
  end

  it do
    expect(subject.executable).to eq('SqlPackage')
  end
  it do
    expect(subject.parameters).to eq(%W|/Action:Publish /SourceFile:testdata/test.dacpac /Profile:testdata/test.publish /p:VerifyDeployment:True /Quiet:True|)
  end
  it do
    expect(subject.is_mono_command?).to be false
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
albacore-2.5.14 spec/sql_package_spec.rb
albacore-2.5.13 spec/sql_package_spec.rb
albacore-2.5.11 spec/sql_package_spec.rb
albacore-2.5.10 spec/sql_package_spec.rb