-
Notifications
You must be signed in to change notification settings - Fork 64
/
Copy pathsql_package_spec.rb
84 lines (71 loc) · 1.87 KB
/
sql_package_spec.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# 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