rake-funnel 0.21.0 → 0.21.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/rake/funnel/extensions/rexml.rb +4 -2
- data/lib/rake/funnel/extensions/shell.rb +2 -2
- data/lib/rake/funnel/integration/progress_report.rb +1 -1
- data/lib/rake/funnel/integration/sync_output.rb +1 -1
- data/lib/rake/funnel/support/timing/report.rb +2 -2
- data/lib/rake/funnel/tasks/msbuild.rb +2 -2
- data/lib/rake/funnel/version.rb +1 -1
- data/rake-funnel.gemspec +1 -1
- data/spec/rake/funnel/extensions/rexml_spec.rb +2 -2
- data/spec/rake/funnel/extensions/shell_spec.rb +8 -10
- data/spec/rake/funnel/integration/progress_report_spec.rb +11 -14
- data/spec/rake/funnel/integration/sync_output_spec.rb +2 -2
- data/spec/rake/funnel/integration/teamcity/nunit_plugin_spec.rb +9 -10
- data/spec/rake/funnel/integration/teamcity/progress_report_spec.rb +34 -30
- data/spec/rake/funnel/integration/teamcity/service_messages_spec.rb +1 -3
- data/spec/rake/funnel/support/argument_mapper/styles/msdeploy_spec.rb +1 -3
- data/spec/rake/funnel/support/argument_mapper/styles/nunit_spec.rb +1 -1
- data/spec/rake/funnel/support/argument_mapper/styles/styles_spec.rb +4 -6
- data/spec/rake/funnel/support/assembly_version/from_version_files_spec.rb +9 -10
- data/spec/rake/funnel/support/assembly_version_writer_spec.rb +7 -9
- data/spec/rake/funnel/support/internal/finder_spec.rb +3 -5
- data/spec/rake/funnel/support/internal/instantiate_symbol_spec.rb +1 -1
- data/spec/rake/funnel/support/mono_spec.rb +3 -4
- data/spec/rake/funnel/support/msdeploy/registry_patch_spec.rb +11 -11
- data/spec/rake/funnel/support/template_engine_spec.rb +4 -4
- data/spec/rake/funnel/support/timing/report_spec.rb +7 -10
- data/spec/rake/funnel/support/version_info_spec.rb +2 -2
- data/spec/rake/funnel/support/zipper_spec.rb +0 -2
- data/spec/rake/funnel/tasks/assembly_version_spec.rb +6 -8
- data/spec/rake/funnel/tasks/bin_path_spec.rb +3 -5
- data/spec/rake/funnel/tasks/copy_spec.rb +6 -12
- data/spec/rake/funnel/tasks/environments_spec.rb +12 -14
- data/spec/rake/funnel/tasks/msbuild_spec.rb +17 -21
- data/spec/rake/funnel/tasks/msdeploy_spec.rb +10 -15
- data/spec/rake/funnel/tasks/nunit_spec.rb +11 -16
- data/spec/rake/funnel/tasks/paket_spec.rb +16 -15
- data/spec/rake/funnel/tasks/quick_template_spec.rb +5 -8
- data/spec/rake/funnel/tasks/side_by_side_specs_spec.rb +5 -8
- data/spec/rake/funnel/tasks/timing_spec.rb +6 -6
- data/spec/rake/funnel/tasks/zip_spec.rb +11 -13
- data/spec/spec_helper.rb +2 -0
- metadata +17 -17
@@ -1,7 +1,5 @@
|
|
1
1
|
require 'erb'
|
2
2
|
|
3
|
-
include Rake::Funnel::Support
|
4
|
-
|
5
3
|
describe Rake::Funnel::Support::AssemblyVersionWriter do
|
6
4
|
describe 'version source' do
|
7
5
|
describe 'default' do
|
@@ -36,7 +34,7 @@ describe Rake::Funnel::Support::AssemblyVersionWriter do
|
|
36
34
|
[
|
37
35
|
{
|
38
36
|
source: 'from e.g. gitversion',
|
39
|
-
version_info: VersionInfo.new(
|
37
|
+
version_info: Rake::Funnel::Support::VersionInfo.new(
|
40
38
|
assembly_version: '1',
|
41
39
|
assembly_file_version: '1.2',
|
42
40
|
assembly_informational_version: '1.2-abc'
|
@@ -60,15 +58,15 @@ describe Rake::Funnel::Support::AssemblyVersionWriter do
|
|
60
58
|
[
|
61
59
|
{
|
62
60
|
source: 'one',
|
63
|
-
version_info: VersionInfo.new(assembly_version: '1',
|
64
|
-
|
65
|
-
|
61
|
+
version_info: Rake::Funnel::Support::VersionInfo.new(assembly_version: '1',
|
62
|
+
assembly_file_version: '1.2',
|
63
|
+
assembly_informational_version: '1.2-abc')
|
66
64
|
},
|
67
65
|
{
|
68
66
|
source: 'two',
|
69
|
-
version_info: VersionInfo.new(assembly_version: '2',
|
70
|
-
|
71
|
-
|
67
|
+
version_info: Rake::Funnel::Support::VersionInfo.new(assembly_version: '2',
|
68
|
+
assembly_file_version: '2.3',
|
69
|
+
assembly_informational_version: '2.3-def')
|
72
70
|
}
|
73
71
|
]
|
74
72
|
end
|
@@ -2,8 +2,6 @@
|
|
2
2
|
|
3
3
|
require 'tmpdir'
|
4
4
|
|
5
|
-
include Rake::Funnel
|
6
|
-
|
7
5
|
describe Rake::Funnel::Support::Finder do
|
8
6
|
let(:pattern) { %W(#{temp_dir}/**/*.sln #{temp_dir}/**/*.??proj) }
|
9
7
|
let(:generate) { [] }
|
@@ -115,7 +113,7 @@ describe Rake::Funnel::Support::Finder do
|
|
115
113
|
context 'no matching files' do
|
116
114
|
it 'should fail' do
|
117
115
|
Dir.chdir(temp_dir) do
|
118
|
-
expect { subject.single }.to raise_error(AmbiguousFileError, /error message/)
|
116
|
+
expect { subject.single }.to raise_error(Rake::Funnel::AmbiguousFileError, /error message/)
|
119
117
|
end
|
120
118
|
end
|
121
119
|
end
|
@@ -125,7 +123,7 @@ describe Rake::Funnel::Support::Finder do
|
|
125
123
|
|
126
124
|
it 'should fail' do
|
127
125
|
Dir.chdir(temp_dir) do
|
128
|
-
expect { subject.single }.to raise_error(AmbiguousFileError, /error message/)
|
126
|
+
expect { subject.single }.to raise_error(Rake::Funnel::AmbiguousFileError, /error message/)
|
129
127
|
end
|
130
128
|
end
|
131
129
|
end
|
@@ -174,7 +172,7 @@ describe Rake::Funnel::Support::Finder do
|
|
174
172
|
describe '#all' do
|
175
173
|
context 'no matching files' do
|
176
174
|
it 'should fail' do
|
177
|
-
expect { subject.all }.to raise_error(AmbiguousFileError, /error message/)
|
175
|
+
expect { subject.all }.to raise_error(Rake::Funnel::AmbiguousFileError, /error message/)
|
178
176
|
end
|
179
177
|
end
|
180
178
|
|
@@ -1,7 +1,5 @@
|
|
1
1
|
require 'tmpdir'
|
2
2
|
|
3
|
-
include Rake::Funnel::Support
|
4
|
-
|
5
3
|
describe Rake::Funnel::Support::Mono do
|
6
4
|
shared_examples 'on Windows' do
|
7
5
|
it 'should return executable' do
|
@@ -53,7 +51,8 @@ describe Rake::Funnel::Support::Mono do
|
|
53
51
|
|
54
52
|
before do
|
55
53
|
allow(File).to receive(:readable?).with('/proc/version').and_return(false)
|
56
|
-
|
54
|
+
|
55
|
+
allow(Rake::Funnel::Support::Which).to receive(:which)
|
57
56
|
end
|
58
57
|
|
59
58
|
before do
|
@@ -65,7 +64,7 @@ describe Rake::Funnel::Support::Mono do
|
|
65
64
|
end
|
66
65
|
|
67
66
|
it 'should resolve executable through which' do
|
68
|
-
expect(Which).to have_received(:which).with('executable.exe')
|
67
|
+
expect(Rake::Funnel::Support::Which).to have_received(:which).with('executable.exe')
|
69
68
|
end
|
70
69
|
|
71
70
|
it 'should support args' do
|
@@ -40,7 +40,7 @@ describe Rake::Funnel::Support::MSDeploy::RegistryPatch do
|
|
40
40
|
context 'on Windows', skip: ('Windows Registry not available' unless defined?(::Win32::Registry)) do
|
41
41
|
let(:root) { Win32::Registry::HKEY_LOCAL_MACHINE }
|
42
42
|
|
43
|
-
let(:
|
43
|
+
let(:registry_keys) do
|
44
44
|
described_class::KEYS.map do |key|
|
45
45
|
instance_double(Win32::Registry, keyname: key)
|
46
46
|
end
|
@@ -62,7 +62,7 @@ describe Rake::Funnel::Support::MSDeploy::RegistryPatch do
|
|
62
62
|
|
63
63
|
context 'MSDeploy registry key and "Version" value does not exist' do
|
64
64
|
before do
|
65
|
-
|
65
|
+
registry_keys.each do |key|
|
66
66
|
allow(key).to receive(:created?).and_return(true)
|
67
67
|
allow(key).to receive(:[]).and_raise(key_access_error)
|
68
68
|
allow(key).to receive(:[]=)
|
@@ -71,7 +71,7 @@ describe Rake::Funnel::Support::MSDeploy::RegistryPatch do
|
|
71
71
|
end
|
72
72
|
|
73
73
|
before do
|
74
|
-
|
74
|
+
registry_keys.each do |key|
|
75
75
|
allow_open_or_create(key)
|
76
76
|
allow_open_for_deletion(key)
|
77
77
|
end
|
@@ -82,17 +82,17 @@ describe Rake::Funnel::Support::MSDeploy::RegistryPatch do
|
|
82
82
|
end
|
83
83
|
|
84
84
|
it 'should create the key' do
|
85
|
-
|
85
|
+
registry_keys.each do |key|
|
86
86
|
expect(root).to have_received(:create).with(key.keyname)
|
87
87
|
end
|
88
88
|
end
|
89
89
|
|
90
90
|
it 'should create the version' do
|
91
|
-
expect(
|
91
|
+
expect(registry_keys).to all(have_received(:[]=).with('Version', described_class::FAKE_VERSION))
|
92
92
|
end
|
93
93
|
|
94
94
|
it 'should delete the key' do
|
95
|
-
|
95
|
+
registry_keys.each do |key| # rubocop:disable RSpec/IteratedExpectation
|
96
96
|
expect(key).to have_received(:delete_key).with(File.basename(key.keyname), true)
|
97
97
|
end
|
98
98
|
end
|
@@ -114,14 +114,14 @@ describe Rake::Funnel::Support::MSDeploy::RegistryPatch do
|
|
114
114
|
|
115
115
|
context 'MSDeploy registry key does exist' do
|
116
116
|
before do
|
117
|
-
|
117
|
+
registry_keys.each do |key|
|
118
118
|
allow_open_or_create(key)
|
119
119
|
end
|
120
120
|
end
|
121
121
|
|
122
122
|
context '"Version" value does not exist' do
|
123
123
|
before do
|
124
|
-
|
124
|
+
registry_keys.each do |key|
|
125
125
|
allow(key).to receive(:created?).and_return(false)
|
126
126
|
allow(key).to receive(:[]).and_raise(key_access_error)
|
127
127
|
allow(key).to receive(:[]=)
|
@@ -134,17 +134,17 @@ describe Rake::Funnel::Support::MSDeploy::RegistryPatch do
|
|
134
134
|
end
|
135
135
|
|
136
136
|
it 'should create the version' do
|
137
|
-
expect(
|
137
|
+
expect(registry_keys).to all(have_received(:[]=).with('Version', described_class::FAKE_VERSION))
|
138
138
|
end
|
139
139
|
|
140
140
|
it 'should delete the version' do
|
141
|
-
expect(
|
141
|
+
expect(registry_keys).to all(have_received(:delete_value).with(described_class::VERSION_VALUE))
|
142
142
|
end
|
143
143
|
end
|
144
144
|
|
145
145
|
context '"Version" value does exist' do
|
146
146
|
before do
|
147
|
-
|
147
|
+
registry_keys.each do |key|
|
148
148
|
allow(key).to receive(:created?).and_return(false)
|
149
149
|
allow(key).to receive(:[])
|
150
150
|
end
|
@@ -17,9 +17,9 @@ describe Rake::Funnel::Support::TemplateEngine do
|
|
17
17
|
|
18
18
|
it 'should omit newlines for pure ruby lines' do
|
19
19
|
# rubocop:disable Layout/IndentHeredoc
|
20
|
-
template = <<-
|
20
|
+
template = <<-TEMPLATE
|
21
21
|
<%= 42 %>
|
22
|
-
|
22
|
+
TEMPLATE
|
23
23
|
# rubocop:enable Layout/IndentHeredoc
|
24
24
|
|
25
25
|
expect(described_class.render(template)).to eq('42')
|
@@ -27,9 +27,9 @@ describe Rake::Funnel::Support::TemplateEngine do
|
|
27
27
|
|
28
28
|
it 'should not omit newlines for mixed ruby lines' do
|
29
29
|
# rubocop:disable Layout/IndentHeredoc
|
30
|
-
template = <<-
|
30
|
+
template = <<-TEMPLATE
|
31
31
|
12 <%= 34 %> 56
|
32
|
-
|
32
|
+
TEMPLATE
|
33
33
|
# rubocop:enable Layout/IndentHeredoc
|
34
34
|
|
35
35
|
expect(described_class.render(template)).to eq("12 34 56\n")
|
@@ -1,8 +1,5 @@
|
|
1
|
-
include Rake
|
2
|
-
include Rake::Funnel::Support::Timing
|
3
|
-
|
4
1
|
describe Rake::Funnel::Support::Timing::Report do
|
5
|
-
include DSL
|
2
|
+
include Rake::DSL
|
6
3
|
|
7
4
|
subject { described_class.new(stats, opts) }
|
8
5
|
|
@@ -10,7 +7,7 @@ describe Rake::Funnel::Support::Timing::Report do
|
|
10
7
|
|
11
8
|
before do
|
12
9
|
allow($stdout).to receive(:puts)
|
13
|
-
allow(
|
10
|
+
allow(Kernel).to receive(:warn)
|
14
11
|
subject.render
|
15
12
|
end
|
16
13
|
|
@@ -44,20 +41,20 @@ describe Rake::Funnel::Support::Timing::Report do
|
|
44
41
|
let(:opts) { { failed: true } }
|
45
42
|
|
46
43
|
it 'should print the failed build status' do
|
47
|
-
expect(
|
44
|
+
expect(Kernel).to have_received(:warn).with(/Status\s+Failed/)
|
48
45
|
end
|
49
46
|
end
|
50
47
|
end
|
51
48
|
|
52
|
-
describe 'empty report' do
|
53
|
-
let(:stats) { Statistics.new }
|
49
|
+
describe 'empty report', include: Rake::Funnel::Support::Timing do
|
50
|
+
let(:stats) { Rake::Funnel::Support::Timing::Statistics.new }
|
54
51
|
|
55
52
|
it_behaves_like :report
|
56
53
|
end
|
57
54
|
|
58
55
|
describe 'report for 2 tasks' do
|
59
56
|
let(:stats) do
|
60
|
-
s = Statistics.new
|
57
|
+
s = Rake::Funnel::Support::Timing::Statistics.new
|
61
58
|
s.benchmark(task(:foo)) {}
|
62
59
|
s.benchmark(task(:bar)) {}
|
63
60
|
s
|
@@ -77,7 +74,7 @@ describe Rake::Funnel::Support::Timing::Report do
|
|
77
74
|
|
78
75
|
describe 'formatting' do
|
79
76
|
let(:stats) do
|
80
|
-
s = Statistics.new
|
77
|
+
s = Rake::Funnel::Support::Timing::Statistics.new
|
81
78
|
s.benchmark(task(task_name)) {}
|
82
79
|
s
|
83
80
|
end
|
@@ -306,10 +306,10 @@ describe Rake::Funnel::Support::VersionInfo do
|
|
306
306
|
let(:file) { 'file with version info' }
|
307
307
|
let(:contents) do
|
308
308
|
# rubocop:disable Layout/IndentHeredoc
|
309
|
-
<<-
|
309
|
+
<<-CONTENTS
|
310
310
|
first line with expected version number
|
311
311
|
other crap
|
312
|
-
|
312
|
+
CONTENTS
|
313
313
|
# rubocop:enable Layout/IndentHeredoc
|
314
314
|
end
|
315
315
|
|
@@ -1,9 +1,6 @@
|
|
1
|
-
include Rake
|
2
|
-
include Rake::Funnel::Support
|
3
|
-
|
4
1
|
describe Rake::Funnel::Tasks::AssemblyVersion do
|
5
2
|
before do
|
6
|
-
Task.clear
|
3
|
+
Rake::Task.clear
|
7
4
|
end
|
8
5
|
|
9
6
|
describe 'defaults' do
|
@@ -21,10 +18,10 @@ describe Rake::Funnel::Tasks::AssemblyVersion do
|
|
21
18
|
end
|
22
19
|
|
23
20
|
describe 'execution' do
|
24
|
-
let(:writer) { instance_double(AssemblyVersionWriter).as_null_object }
|
21
|
+
let(:writer) { instance_double(Rake::Funnel::Support::AssemblyVersionWriter).as_null_object }
|
25
22
|
|
26
23
|
before do
|
27
|
-
allow(AssemblyVersionWriter).to receive(:new).and_return(writer)
|
24
|
+
allow(Rake::Funnel::Support::AssemblyVersionWriter).to receive(:new).and_return(writer)
|
28
25
|
end
|
29
26
|
|
30
27
|
subject do
|
@@ -37,11 +34,12 @@ describe Rake::Funnel::Tasks::AssemblyVersion do
|
|
37
34
|
end
|
38
35
|
|
39
36
|
before do
|
40
|
-
Task[subject.name].invoke
|
37
|
+
Rake::Task[subject.name].invoke
|
41
38
|
end
|
42
39
|
|
43
40
|
it 'should pass source and source_args' do
|
44
|
-
expect(AssemblyVersionWriter).to have_received(:new)
|
41
|
+
expect(Rake::Funnel::Support::AssemblyVersionWriter).to have_received(:new)
|
42
|
+
.with(subject.source, subject.source_args)
|
45
43
|
end
|
46
44
|
|
47
45
|
it 'should use writer' do
|
@@ -1,8 +1,6 @@
|
|
1
|
-
include Rake
|
2
|
-
|
3
1
|
describe Rake::Funnel::Tasks::BinPath do
|
4
2
|
before do
|
5
|
-
Task.clear
|
3
|
+
Rake::Task.clear
|
6
4
|
end
|
7
5
|
|
8
6
|
describe 'defaults' do
|
@@ -42,7 +40,7 @@ describe Rake::Funnel::Tasks::BinPath do
|
|
42
40
|
end
|
43
41
|
|
44
42
|
before do
|
45
|
-
Task[subject.name].invoke
|
43
|
+
Rake::Task[subject.name].invoke
|
46
44
|
end
|
47
45
|
|
48
46
|
it 'should prepend sorted matching folders to the PATH environment variable' do
|
@@ -96,7 +94,7 @@ describe Rake::Funnel::Tasks::BinPath do
|
|
96
94
|
end
|
97
95
|
|
98
96
|
before do
|
99
|
-
Task[subject.name].invoke
|
97
|
+
Rake::Task[subject.name].invoke
|
100
98
|
end
|
101
99
|
|
102
100
|
it 'should not print message' do
|
@@ -1,9 +1,6 @@
|
|
1
|
-
include Rake
|
2
|
-
include Rake::Funnel::Support
|
3
|
-
|
4
1
|
describe Rake::Funnel::Tasks::Copy do
|
5
2
|
before do
|
6
|
-
Task.clear
|
3
|
+
Rake::Task.clear
|
7
4
|
end
|
8
5
|
|
9
6
|
describe 'defaults' do
|
@@ -15,15 +12,12 @@ describe Rake::Funnel::Tasks::Copy do
|
|
15
12
|
describe 'execution' do
|
16
13
|
let(:source) { %w(one two) }
|
17
14
|
let(:target) { 'target' }
|
18
|
-
let(:finder) { instance_double(Finder).as_null_object }
|
15
|
+
let(:finder) { instance_double(Rake::Funnel::Support::Finder).as_null_object }
|
19
16
|
|
20
17
|
before do
|
21
18
|
allow(finder).to receive(:all_or_default).and_return(source)
|
22
|
-
allow(Finder).to receive(:new).and_return(finder)
|
23
|
-
|
24
|
-
|
25
|
-
before do
|
26
|
-
allow(Copier).to receive(:copy)
|
19
|
+
allow(Rake::Funnel::Support::Finder).to receive(:new).and_return(finder)
|
20
|
+
allow(Rake::Funnel::Support::Copier).to receive(:copy)
|
27
21
|
end
|
28
22
|
|
29
23
|
subject do
|
@@ -34,11 +28,11 @@ describe Rake::Funnel::Tasks::Copy do
|
|
34
28
|
end
|
35
29
|
|
36
30
|
before do
|
37
|
-
Task[subject.name].invoke
|
31
|
+
Rake::Task[subject.name].invoke
|
38
32
|
end
|
39
33
|
|
40
34
|
it 'should delegate to Copier' do
|
41
|
-
expect(Copier).to have_received(:copy).with(source, subject.target)
|
35
|
+
expect(Rake::Funnel::Support::Copier).to have_received(:copy).with(source, subject.target)
|
42
36
|
end
|
43
37
|
end
|
44
38
|
end
|
@@ -1,14 +1,10 @@
|
|
1
1
|
require 'configatron'
|
2
2
|
|
3
|
-
include Rake
|
4
|
-
include Rake::Funnel::Support::Environments
|
5
|
-
include Rake::Funnel::Tasks
|
6
|
-
|
7
3
|
describe Rake::Funnel::Tasks::Environments do
|
8
4
|
include Rake::DSL
|
9
5
|
|
10
6
|
before do
|
11
|
-
Task.clear
|
7
|
+
Rake::Task.clear
|
12
8
|
end
|
13
9
|
|
14
10
|
let(:files) { [] }
|
@@ -90,7 +86,7 @@ describe Rake::Funnel::Tasks::Environments do
|
|
90
86
|
end
|
91
87
|
|
92
88
|
before do
|
93
|
-
allow(Loader).to receive(:load_configuration)
|
89
|
+
allow(Rake::Funnel::Support::Environments::Loader).to receive(:load_configuration)
|
94
90
|
end
|
95
91
|
|
96
92
|
before do
|
@@ -105,18 +101,19 @@ describe Rake::Funnel::Tasks::Environments do
|
|
105
101
|
end
|
106
102
|
|
107
103
|
before do
|
108
|
-
Task['dev'].invoke
|
104
|
+
Rake::Task['dev'].invoke
|
109
105
|
end
|
110
106
|
|
111
107
|
it 'should store configuration in configatron singleton' do
|
112
|
-
expect(Loader).to
|
108
|
+
expect(Rake::Funnel::Support::Environments::Loader).to \
|
109
|
+
have_received(:load_configuration).with(anything, configatron, any_args)
|
113
110
|
end
|
114
111
|
|
115
112
|
context 'default and local config files exist' do
|
116
113
|
let(:optional) { nil }
|
117
114
|
|
118
115
|
it 'should load all files' do
|
119
|
-
expect(Loader)
|
116
|
+
expect(Rake::Funnel::Support::Environments::Loader)
|
120
117
|
.to have_received(:load_configuration)
|
121
118
|
.with(hash_including(config_files: %w(config/default.yaml config/dev.yaml config/local.yaml)), any_args)
|
122
119
|
end
|
@@ -126,7 +123,7 @@ describe Rake::Funnel::Tasks::Environments do
|
|
126
123
|
let(:optional) { 'config/default.yaml' }
|
127
124
|
|
128
125
|
it 'should load environment file and local file' do
|
129
|
-
expect(Loader)
|
126
|
+
expect(Rake::Funnel::Support::Environments::Loader)
|
130
127
|
.to have_received(:load_configuration)
|
131
128
|
.with(hash_including(config_files: %w(config/dev.yaml config/local.yaml)), any_args)
|
132
129
|
end
|
@@ -136,7 +133,7 @@ describe Rake::Funnel::Tasks::Environments do
|
|
136
133
|
let(:optional) { 'config/local.yaml' }
|
137
134
|
|
138
135
|
it 'should load default file and environment file' do
|
139
|
-
expect(Loader).to \
|
136
|
+
expect(Rake::Funnel::Support::Environments::Loader).to \
|
140
137
|
have_received(:load_configuration)
|
141
138
|
.with(hash_including(config_files: %w(config/default.yaml config/dev.yaml)),
|
142
139
|
any_args)
|
@@ -157,15 +154,16 @@ describe Rake::Funnel::Tasks::Environments do
|
|
157
154
|
end
|
158
155
|
|
159
156
|
before do
|
160
|
-
allow(Loader).to receive(:load_configuration)
|
157
|
+
allow(Rake::Funnel::Support::Environments::Loader).to receive(:load_configuration)
|
161
158
|
end
|
162
159
|
|
163
160
|
before do
|
164
|
-
Task['dev'].invoke
|
161
|
+
Rake::Task['dev'].invoke
|
165
162
|
end
|
166
163
|
|
167
164
|
it 'should pass customizer to loader' do
|
168
|
-
expect(Loader).to
|
165
|
+
expect(Rake::Funnel::Support::Environments::Loader).to \
|
166
|
+
have_received(:load_configuration).with(anything, anything, customizer)
|
169
167
|
end
|
170
168
|
end
|
171
169
|
|
@@ -1,25 +1,20 @@
|
|
1
1
|
# rubocop:disable RSpec/FilePath
|
2
2
|
|
3
|
-
include Rake
|
4
|
-
include Rake::Funnel
|
5
|
-
include Rake::Funnel::Support
|
6
|
-
include Rake::Funnel::Support::MSBuild
|
7
|
-
|
8
3
|
describe Rake::Funnel::Tasks::MSBuild do
|
9
4
|
before do
|
10
|
-
Task.clear
|
5
|
+
Rake::Task.clear
|
11
6
|
end
|
12
7
|
|
13
8
|
describe 'defaults' do
|
14
9
|
its(:name) { should == :compile }
|
15
|
-
its(:project_or_solution) { should be_instance_of(Finder) }
|
10
|
+
its(:project_or_solution) { should be_instance_of(Rake::Funnel::Support::Finder) }
|
16
11
|
its(:args) { should == {} }
|
17
12
|
its(:search_pattern) { should == %w(**/*.sln) }
|
18
13
|
its(:msbuild) { should be_nil }
|
19
14
|
|
20
15
|
describe 'build tool finder' do
|
21
16
|
before do
|
22
|
-
allow(BuildTool).to receive(:find).and_return('build tool')
|
17
|
+
allow(Rake::Funnel::Support::MSBuild::BuildTool).to receive(:find).and_return('build tool')
|
23
18
|
end
|
24
19
|
|
25
20
|
it 'should use build tool finder' do
|
@@ -31,19 +26,19 @@ describe Rake::Funnel::Tasks::MSBuild do
|
|
31
26
|
describe 'execution' do
|
32
27
|
let(:args) { {} }
|
33
28
|
|
34
|
-
let(:mapper) { instance_double(Mapper).as_null_object }
|
35
|
-
let(:finder) { instance_double(Finder).as_null_object }
|
29
|
+
let(:mapper) { instance_double(Rake::Funnel::Support::Mapper).as_null_object }
|
30
|
+
let(:finder) { instance_double(Rake::Funnel::Support::Finder).as_null_object }
|
36
31
|
|
37
32
|
before do
|
38
33
|
allow(subject).to receive(:sh)
|
39
34
|
|
40
|
-
allow(Mapper).to receive(:new).and_return(mapper)
|
41
|
-
allow(Finder).to receive(:new).and_return(finder)
|
42
|
-
allow(BuildTool).to receive(:find)
|
35
|
+
allow(Rake::Funnel::Support::Mapper).to receive(:new).and_return(mapper)
|
36
|
+
allow(Rake::Funnel::Support::Finder).to receive(:new).and_return(finder)
|
37
|
+
allow(Rake::Funnel::Support::MSBuild::BuildTool).to receive(:find)
|
43
38
|
end
|
44
39
|
|
45
40
|
before do
|
46
|
-
Task[subject.name].invoke
|
41
|
+
Rake::Task[subject.name].invoke
|
47
42
|
end
|
48
43
|
|
49
44
|
it 'should use solution finder' do
|
@@ -51,11 +46,11 @@ describe Rake::Funnel::Tasks::MSBuild do
|
|
51
46
|
end
|
52
47
|
|
53
48
|
it 'should use MSBuild finder' do
|
54
|
-
expect(BuildTool).to have_received(:find)
|
49
|
+
expect(Rake::Funnel::Support::MSBuild::BuildTool).to have_received(:find)
|
55
50
|
end
|
56
51
|
|
57
52
|
it 'should use MSBuild mapper' do
|
58
|
-
expect(Mapper).to have_received(:new).with(:MSBuild)
|
53
|
+
expect(Rake::Funnel::Support::Mapper).to have_received(:new).with(:MSBuild)
|
59
54
|
end
|
60
55
|
|
61
56
|
it 'should map arguments' do
|
@@ -79,7 +74,7 @@ describe Rake::Funnel::Tasks::MSBuild do
|
|
79
74
|
|
80
75
|
context 'when project or solution is specified' do
|
81
76
|
before do
|
82
|
-
allow(Finder).to receive(:new).and_call_original
|
77
|
+
allow(Rake::Funnel::Support::Finder).to receive(:new).and_call_original
|
83
78
|
end
|
84
79
|
|
85
80
|
subject do
|
@@ -88,12 +83,13 @@ describe Rake::Funnel::Tasks::MSBuild do
|
|
88
83
|
end
|
89
84
|
end
|
90
85
|
|
91
|
-
its(:project_or_solution) { should be_instance_of(Finder) }
|
86
|
+
its(:project_or_solution) { should be_instance_of(Rake::Funnel::Support::Finder) }
|
92
87
|
|
93
88
|
it 'should set project or solution' do
|
94
|
-
expect(Finder).to have_received(:new)
|
95
|
-
|
96
|
-
|
89
|
+
expect(Rake::Funnel::Support::Finder).to have_received(:new)
|
90
|
+
.with('project.sln',
|
91
|
+
subject,
|
92
|
+
'No projects or more than one project found.')
|
97
93
|
end
|
98
94
|
end
|
99
95
|
end
|
@@ -1,13 +1,8 @@
|
|
1
1
|
# rubocop:disable RSpec/FilePath
|
2
2
|
|
3
|
-
include Rake
|
4
|
-
include Rake::Funnel
|
5
|
-
include Rake::Funnel::Support
|
6
|
-
include Rake::Funnel::Support::MSDeploy
|
7
|
-
|
8
3
|
describe Rake::Funnel::Tasks::MSDeploy do
|
9
4
|
before do
|
10
|
-
Task.clear
|
5
|
+
Rake::Task.clear
|
11
6
|
end
|
12
7
|
|
13
8
|
describe 'defaults' do
|
@@ -37,22 +32,22 @@ describe Rake::Funnel::Tasks::MSDeploy do
|
|
37
32
|
before do
|
38
33
|
allow(subject).to receive(:shell)
|
39
34
|
|
40
|
-
allow(RegistryPatch).to receive(:new).and_yield
|
35
|
+
allow(Rake::Funnel::Support::MSDeploy::RegistryPatch).to receive(:new).and_yield
|
41
36
|
end
|
42
37
|
|
43
38
|
describe 'argument mapping and invocation' do
|
44
|
-
let(:mapper) { instance_double(Mapper).as_null_object }
|
39
|
+
let(:mapper) { instance_double(Rake::Funnel::Support::Mapper).as_null_object }
|
45
40
|
|
46
41
|
before do
|
47
|
-
allow(Mapper).to receive(:new).and_return(mapper)
|
42
|
+
allow(Rake::Funnel::Support::Mapper).to receive(:new).and_return(mapper)
|
48
43
|
end
|
49
44
|
|
50
45
|
before do
|
51
|
-
Task[subject.name].invoke
|
46
|
+
Rake::Task[subject.name].invoke
|
52
47
|
end
|
53
48
|
|
54
49
|
it 'should use MSDeploy mapper' do
|
55
|
-
expect(Mapper).to have_received(:new).with(:MSDeploy)
|
50
|
+
expect(Rake::Funnel::Support::Mapper).to have_received(:new).with(:MSDeploy)
|
56
51
|
end
|
57
52
|
|
58
53
|
it 'should map arguments' do
|
@@ -68,7 +63,7 @@ describe Rake::Funnel::Tasks::MSDeploy do
|
|
68
63
|
|
69
64
|
describe 'arg examples' do
|
70
65
|
before do
|
71
|
-
Task[subject.name].invoke
|
66
|
+
Rake::Task[subject.name].invoke
|
72
67
|
end
|
73
68
|
|
74
69
|
context 'skip actions' do
|
@@ -148,7 +143,7 @@ describe Rake::Funnel::Tasks::MSDeploy do
|
|
148
143
|
verb: :sync,
|
149
144
|
pre_sync: {
|
150
145
|
run_command: 'cd "C:\Program Files"',
|
151
|
-
dont_use_command_exe:
|
146
|
+
dont_use_command_exe: true
|
152
147
|
},
|
153
148
|
source: {
|
154
149
|
content_path: 'deploy'
|
@@ -177,12 +172,12 @@ describe Rake::Funnel::Tasks::MSDeploy do
|
|
177
172
|
|
178
173
|
describe "MSDeploy's idiocy" do
|
179
174
|
before do
|
180
|
-
Task[subject.name].invoke
|
175
|
+
Rake::Task[subject.name].invoke
|
181
176
|
end
|
182
177
|
|
183
178
|
describe 'version registry value that is required to exist' do
|
184
179
|
it 'should patch the registry' do
|
185
|
-
expect(RegistryPatch).to have_received(:new)
|
180
|
+
expect(Rake::Funnel::Support::MSDeploy::RegistryPatch).to have_received(:new)
|
186
181
|
end
|
187
182
|
end
|
188
183
|
|