Sha256: a25ccacf8fcd6f889ac86a7efa36bdb1eb70a3ee14e7ab3e007b0ac5b24a4b17

Contents?: true

Size: 1.87 KB

Versions: 17

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

17 entries across 17 versions & 1 rubygems

Version Path
albacore-3.0.1 spec/sql_package_spec.rb
albacore-3.0.0.pre.alpha.6 spec/sql_package_spec.rb
albacore-3.0.0.pre.alpha.5 spec/sql_package_spec.rb
albacore-3.0.0.pre.alpha.4 spec/sql_package_spec.rb
albacore-3.0.0.pre.alpha.3 spec/sql_package_spec.rb
albacore-3.0.0.pre.alpha.2 spec/sql_package_spec.rb
albacore-3.0.0.pre.alpha spec/sql_package_spec.rb
albacore-2.8.0 spec/sql_package_spec.rb
albacore-2.7.0 spec/sql_package_spec.rb
albacore-2.6.8 spec/sql_package_spec.rb
albacore-2.6.7 spec/sql_package_spec.rb
albacore-2.6.6 spec/sql_package_spec.rb
albacore-2.6.4 spec/sql_package_spec.rb
albacore-2.6.3 spec/sql_package_spec.rb
albacore-2.6.2 spec/sql_package_spec.rb
albacore-2.6.1 spec/sql_package_spec.rb
albacore-2.6.0 spec/sql_package_spec.rb