-
Notifications
You must be signed in to change notification settings - Fork 64
/
build_spec.rb
63 lines (55 loc) · 1.44 KB
/
build_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
require 'spec_helper'
require 'support/sh_interceptor'
require 'albacore'
require 'albacore/task_types/build'
describe 'build config' do
subject do
Albacore::Build::Config.new
end
%w[files= file= sln= target target= logging logging= prop cores cores= tools_version tools_version=].each do |writer|
it "should respond to :#{writer}" do
expect(subject).to respond_to(:"#{writer}")
end
end
it 'should not have any property' do
expect(subject).to_not respond_to(:something_nonexistent)
end
describe 'when setting properties' do
before do
subject.logging = 'minimal'
subject.tools_version = '3.5'
end
it do
expect(subject.parameters).to include('/verbosity:minimal')
expect(subject.parameters).to include('/toolsversion:3.5')
end
end
end
describe 'when running with sln' do
let :cfg do
Albacore::Build::Config.new
end
include_context 'path testing'
let(:cmd) do
cmd = Albacore::Build::Cmd.new cfg.work_dir, 'xbuild', cfg.parameters
cmd.extend ShInterceptor
end
before do
cfg.sln = 'src/HelloWorld.sln'
cfg.params_for_file cfg.sln
cfg.target = %w|Clean Build|
cmd.execute
end
subject do
cmd
end
it do
expect(subject.executable).to eq('xbuild')
end
it do
expect(subject.parameters).to eq(%W|/verbosity:minimal #{path 'src/HelloWorld.sln'} /target:Clean;Build|)
end
it do
expect(subject.is_mono_command?).to be false
end
end