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
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1da0eb5718b82d9a3b3276c0d5465db3ef8e6008
|
4
|
+
data.tar.gz: f50c9c0334e893826dda3a1bbe6e266e2ec1dea4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b4fda8404ed1fb5b012b00c0654e928be757a61d2e4e1a5a31395b586cca9c45d3a353c8b5dc2ef322a4bdc9fda07c2c2b598524681cc9f2ae09b7942a69d410
|
7
|
+
data.tar.gz: 3de0fef1d05c1aa02bb6579f398e311b6c84ef10c9186157a2bc394ab5834309af2790bad75c73fe143b53046e7d7b356b57848eb8223e4eae8bbc659a3a1d16
|
@@ -20,8 +20,10 @@ end
|
|
20
20
|
|
21
21
|
module REXML
|
22
22
|
module Functions
|
23
|
-
|
24
|
-
|
23
|
+
extend Rake::Funnel::Extensions::REXML::Functions
|
24
|
+
|
25
|
+
Rake::Funnel::Extensions::REXML::Functions.public_instance_methods.each do |method|
|
26
|
+
singleton_method_added(method)
|
25
27
|
end
|
26
28
|
end
|
27
29
|
end
|
@@ -70,14 +70,14 @@ module Rake
|
|
70
70
|
end
|
71
71
|
|
72
72
|
def to_stdout(line)
|
73
|
-
$stdout.puts
|
73
|
+
$stdout.puts(line.rstrip.green)
|
74
74
|
:success
|
75
75
|
end
|
76
76
|
|
77
77
|
def to_stderr(line, error_lines)
|
78
78
|
return unless error_lines && line =~ error_lines
|
79
79
|
|
80
|
-
|
80
|
+
Kernel.warn(line.rstrip.bold.red)
|
81
81
|
:error
|
82
82
|
end
|
83
83
|
end
|
@@ -84,9 +84,9 @@ module Rake
|
|
84
84
|
status = 'Status'.ljust(columns[0].width) + ' ' * SPACE + status
|
85
85
|
|
86
86
|
if @opts[:failed]
|
87
|
-
|
87
|
+
Kernel.warn(status.bold.red)
|
88
88
|
else
|
89
|
-
$stdout.puts
|
89
|
+
$stdout.puts(status.bold.green)
|
90
90
|
end
|
91
91
|
end
|
92
92
|
end
|
@@ -8,7 +8,7 @@ module Rake
|
|
8
8
|
include Rake::Funnel::Support::MSBuild
|
9
9
|
|
10
10
|
attr_accessor :name, :msbuild, :msbuild_finder, :project_or_solution, :args, :search_pattern
|
11
|
-
attr_writer :project_or_solution
|
11
|
+
attr_writer :project_or_solution # rubocop:disable Lint/DuplicateMethods
|
12
12
|
|
13
13
|
def initialize(*args, &task_block)
|
14
14
|
setup_ivars(args)
|
@@ -16,7 +16,7 @@ module Rake
|
|
16
16
|
define(args, &task_block)
|
17
17
|
end
|
18
18
|
|
19
|
-
def project_or_solution
|
19
|
+
def project_or_solution # rubocop:disable Lint/DuplicateMethods
|
20
20
|
Finder.new(@project_or_solution || search_pattern, self, 'No projects or more than one project found.')
|
21
21
|
end
|
22
22
|
|
data/lib/rake/funnel/version.rb
CHANGED
data/rake-funnel.gemspec
CHANGED
@@ -15,10 +15,10 @@ Gem::Specification.new do |s| # rubocop:disable Metrics/BlockLength
|
|
15
15
|
|
16
16
|
s.required_ruby_version = '>= 2.0.0'
|
17
17
|
|
18
|
+
s.add_dependency 'configatron', '~> 4.5'
|
18
19
|
s.add_dependency 'rake', '>= 10.4', '< 13'
|
19
20
|
s.add_dependency 'rubyzip', '~> 1.0'
|
20
21
|
s.add_dependency 'smart_colored'
|
21
|
-
s.add_dependency 'configatron', '~> 4.5'
|
22
22
|
|
23
23
|
git = ENV['TEAMCITY_GIT_PATH'] || 'git'
|
24
24
|
files = `"#{git}" ls-files -z`
|
@@ -2,13 +2,13 @@
|
|
2
2
|
|
3
3
|
describe Rake::Funnel::Extensions::REXML::Functions do
|
4
4
|
let(:xml) do
|
5
|
-
<<
|
5
|
+
<<XML
|
6
6
|
<editors xmlns="http://example.com">
|
7
7
|
<editor id="emacs">EMACS</editor>
|
8
8
|
<editor id="vi">VIM</editor>
|
9
9
|
<editor id="notepad">Notepad</editor>
|
10
10
|
</editors>
|
11
|
-
|
11
|
+
XML
|
12
12
|
end
|
13
13
|
|
14
14
|
subject { REXML::Document.new(xml) }
|
@@ -1,13 +1,11 @@
|
|
1
1
|
require 'open3'
|
2
2
|
|
3
|
-
include Rake::Funnel
|
4
|
-
|
5
3
|
describe Rake::Funnel::Extensions::Shell do
|
6
4
|
before do
|
7
5
|
allow(Open3).to receive(:popen2e).and_yield(nil, stdout_and_stderr, exit)
|
8
6
|
|
9
7
|
allow($stdout).to receive(:puts)
|
10
|
-
allow(
|
8
|
+
allow(Kernel).to receive(:warn)
|
11
9
|
allow(Rake).to receive(:rake_output_message)
|
12
10
|
end
|
13
11
|
|
@@ -126,13 +124,13 @@ describe Rake::Funnel::Extensions::Shell do
|
|
126
124
|
before do
|
127
125
|
begin
|
128
126
|
subject.shell('foo', error_lines: error_lines)
|
129
|
-
rescue ExecutionError # rubocop:disable Lint/HandleExceptions
|
127
|
+
rescue Rake::Funnel::ExecutionError # rubocop:disable Lint/HandleExceptions
|
130
128
|
end
|
131
129
|
end
|
132
130
|
|
133
131
|
context 'no lines indicating errors' do
|
134
132
|
it 'should not log to stderr' do
|
135
|
-
expect(
|
133
|
+
expect(Kernel).not_to have_received(:warn)
|
136
134
|
end
|
137
135
|
end
|
138
136
|
|
@@ -144,7 +142,7 @@ describe Rake::Funnel::Extensions::Shell do
|
|
144
142
|
end
|
145
143
|
|
146
144
|
it 'should log to stderr on error' do
|
147
|
-
expect(
|
145
|
+
expect(Kernel).to have_received(:warn).with(/error/)
|
148
146
|
end
|
149
147
|
|
150
148
|
it 'should not log to stdout on error' do
|
@@ -152,7 +150,7 @@ describe Rake::Funnel::Extensions::Shell do
|
|
152
150
|
end
|
153
151
|
|
154
152
|
it 'should colorize error lines' do
|
155
|
-
expect(
|
153
|
+
expect(Kernel).to have_received(:warn).with('error'.bold.red)
|
156
154
|
end
|
157
155
|
|
158
156
|
it 'should log to stdout after error' do
|
@@ -164,7 +162,7 @@ describe Rake::Funnel::Extensions::Shell do
|
|
164
162
|
let(:stdout_and_stderr) { StringIO.new('error äöüß'.encode('CP850')) }
|
165
163
|
|
166
164
|
it 'should log to stdout before error' do
|
167
|
-
expect(
|
165
|
+
expect(Kernel).to have_received(:warn).with(/error/)
|
168
166
|
end
|
169
167
|
end
|
170
168
|
end
|
@@ -195,7 +193,7 @@ describe Rake::Funnel::Extensions::Shell do
|
|
195
193
|
context 'error lines logged' do
|
196
194
|
context 'without block' do
|
197
195
|
it 'should fail' do
|
198
|
-
expect { subject.shell('foo', error_lines: /.*/) }.to raise_error(ExecutionError)
|
196
|
+
expect { subject.shell('foo', error_lines: /.*/) }.to raise_error(Rake::Funnel::ExecutionError)
|
199
197
|
end
|
200
198
|
end
|
201
199
|
|
@@ -218,7 +216,7 @@ describe Rake::Funnel::Extensions::Shell do
|
|
218
216
|
|
219
217
|
context 'without block' do
|
220
218
|
it 'should fail' do
|
221
|
-
expect { subject.shell('foo') }.to raise_error(ExecutionError)
|
219
|
+
expect { subject.shell('foo') }.to raise_error(Rake::Funnel::ExecutionError)
|
222
220
|
end
|
223
221
|
|
224
222
|
it 'should report the exit code' do
|
@@ -1,16 +1,13 @@
|
|
1
|
-
include Rake
|
2
|
-
include Rake::Funnel::Integration
|
3
|
-
|
4
1
|
describe Rake::Funnel::Integration::ProgressReport do
|
5
|
-
include DSL
|
2
|
+
include Rake::DSL
|
6
3
|
|
7
4
|
let(:teamcity_running?) { false }
|
8
5
|
|
9
6
|
before do
|
10
7
|
allow($stdout).to receive(:puts)
|
11
|
-
allow(TeamCity).to receive(:running?).and_return(teamcity_running?)
|
8
|
+
allow(Rake::Funnel::Integration::TeamCity).to receive(:running?).and_return(teamcity_running?)
|
12
9
|
|
13
|
-
Task.clear
|
10
|
+
Rake::Task.clear
|
14
11
|
end
|
15
12
|
|
16
13
|
after do
|
@@ -25,7 +22,7 @@ describe Rake::Funnel::Integration::ProgressReport do
|
|
25
22
|
before do
|
26
23
|
task :task
|
27
24
|
|
28
|
-
Task[:task].invoke
|
25
|
+
Rake::Task[:task].invoke
|
29
26
|
end
|
30
27
|
|
31
28
|
context 'not on TeamCity' do
|
@@ -53,7 +50,7 @@ describe Rake::Funnel::Integration::ProgressReport do
|
|
53
50
|
|
54
51
|
task :task
|
55
52
|
|
56
|
-
Task[:task].invoke
|
53
|
+
Rake::Task[:task].invoke
|
57
54
|
end
|
58
55
|
|
59
56
|
it 'should not write' do
|
@@ -83,7 +80,7 @@ describe Rake::Funnel::Integration::ProgressReport do
|
|
83
80
|
before do
|
84
81
|
task :task
|
85
82
|
|
86
|
-
Task[:task].invoke
|
83
|
+
Rake::Task[:task].invoke
|
87
84
|
end
|
88
85
|
|
89
86
|
describe 'starting handler' do
|
@@ -92,11 +89,11 @@ describe Rake::Funnel::Integration::ProgressReport do
|
|
92
89
|
end
|
93
90
|
|
94
91
|
it 'should receive task' do
|
95
|
-
expect(receiver).to have_received(:task_starting).with(hash_including(task: kind_of(Task)))
|
92
|
+
expect(receiver).to have_received(:task_starting).with(hash_including(task: kind_of(Rake::Task)))
|
96
93
|
end
|
97
94
|
|
98
95
|
it 'should receive task arguments' do
|
99
|
-
expect(receiver).to have_received(:task_starting).with(hash_including(args: kind_of(TaskArguments)))
|
96
|
+
expect(receiver).to have_received(:task_starting).with(hash_including(args: kind_of(Rake::TaskArguments)))
|
100
97
|
end
|
101
98
|
end
|
102
99
|
|
@@ -106,11 +103,11 @@ describe Rake::Funnel::Integration::ProgressReport do
|
|
106
103
|
end
|
107
104
|
|
108
105
|
it 'should receive task' do
|
109
|
-
expect(receiver).to have_received(:task_finished).with(hash_including(task: kind_of(Task)))
|
106
|
+
expect(receiver).to have_received(:task_finished).with(hash_including(task: kind_of(Rake::Task)))
|
110
107
|
end
|
111
108
|
|
112
109
|
it 'should receive task arguments' do
|
113
|
-
expect(receiver).to have_received(:task_finished).with(hash_including(args: kind_of(TaskArguments)))
|
110
|
+
expect(receiver).to have_received(:task_finished).with(hash_including(args: kind_of(Rake::TaskArguments)))
|
114
111
|
end
|
115
112
|
|
116
113
|
it 'should not receive error' do
|
@@ -130,7 +127,7 @@ describe Rake::Funnel::Integration::ProgressReport do
|
|
130
127
|
end
|
131
128
|
|
132
129
|
begin
|
133
|
-
Task[:task].invoke
|
130
|
+
Rake::Task[:task].invoke
|
134
131
|
rescue SpecificError # rubocop:disable Lint/HandleExceptions
|
135
132
|
end
|
136
133
|
end
|
@@ -4,7 +4,7 @@ describe Rake::Funnel::Integration::SyncOutput do
|
|
4
4
|
allow($stdout).to receive(:sync=)
|
5
5
|
allow($stderr).to receive(:sync=)
|
6
6
|
|
7
|
-
expect(subject).to be
|
7
|
+
expect(subject).to be # rubocop:disable RSpec/ExpectInHook
|
8
8
|
end
|
9
9
|
|
10
10
|
it 'should immediately flush $stdout' do
|
@@ -23,7 +23,7 @@ describe Rake::Funnel::Integration::SyncOutput do
|
|
23
23
|
|
24
24
|
allow(Rake).to receive(:rake_output_message)
|
25
25
|
|
26
|
-
expect(subject).to be
|
26
|
+
expect(subject).to be # rubocop:disable RSpec/ExpectInHook
|
27
27
|
end
|
28
28
|
|
29
29
|
it 'should log the error for $stdout' do
|
@@ -1,25 +1,24 @@
|
|
1
1
|
# rubocop:disable RSpec/FilePath
|
2
2
|
|
3
|
-
include Rake::Funnel::Support
|
4
|
-
|
5
3
|
describe Rake::Funnel::Integration::TeamCity::NUnitPlugin do
|
6
4
|
before do
|
7
5
|
allow(ENV).to receive(:[]).with(described_class::ENV_VAR).and_return(env_var)
|
8
|
-
allow(Which).to receive(:which).and_return(which)
|
6
|
+
allow(Rake::Funnel::Support::Which).to receive(:which).and_return(which)
|
9
7
|
allow(Dir).to receive(:glob).and_return([])
|
10
8
|
allow(RakeFileUtils).to receive(:mkdir_p)
|
11
9
|
allow(Rake).to receive(:rake_output_message)
|
12
10
|
end
|
13
11
|
|
14
12
|
before do
|
15
|
-
allow(BinaryVersionReader).to receive(:read_from)
|
13
|
+
allow(Rake::Funnel::Support::BinaryVersionReader).to receive(:read_from)
|
14
|
+
.with(which).and_return(nunit_version)
|
16
15
|
end
|
17
16
|
|
18
17
|
describe 'success' do
|
19
18
|
let(:env_var) { '/path/to/nunit plugins/nunit' }
|
20
19
|
let(:addin_dlls) { [env_var + 'addin.dll'] }
|
21
20
|
let(:which) { 'path/to/nunit-console.exe' }
|
22
|
-
let(:nunit_version) { VersionInfo.new(file_version: '1.2.3.4') }
|
21
|
+
let(:nunit_version) { Rake::Funnel::Support::VersionInfo.new(file_version: '1.2.3.4') }
|
23
22
|
let(:plugin_version) { nunit_version.file_version.split('.').take(3).join('.') }
|
24
23
|
|
25
24
|
before do
|
@@ -53,7 +52,7 @@ describe Rake::Funnel::Integration::TeamCity::NUnitPlugin do
|
|
53
52
|
end
|
54
53
|
|
55
54
|
context 'Windows-style path in environment variable',
|
56
|
-
skip:
|
55
|
+
skip: !Gem.win_platform? do
|
57
56
|
let(:env_var) { 'C:\path\to\nunit plugins\nunit-' }
|
58
57
|
|
59
58
|
it 'should convert path to Ruby-style' do
|
@@ -65,7 +64,7 @@ describe Rake::Funnel::Integration::TeamCity::NUnitPlugin do
|
|
65
64
|
describe 'failures' do
|
66
65
|
let(:env_var) { nil }
|
67
66
|
let(:which) { nil }
|
68
|
-
let(:nunit_version) { VersionInfo.new }
|
67
|
+
let(:nunit_version) { Rake::Funnel::Support::VersionInfo.new }
|
69
68
|
|
70
69
|
before do
|
71
70
|
described_class.setup('nunit-console.exe')
|
@@ -75,7 +74,7 @@ describe Rake::Funnel::Integration::TeamCity::NUnitPlugin do
|
|
75
74
|
let(:env_var) { nil }
|
76
75
|
|
77
76
|
it 'should skip reading the version' do
|
78
|
-
expect(BinaryVersionReader).not_to have_received(:read_from)
|
77
|
+
expect(Rake::Funnel::Support::BinaryVersionReader).not_to have_received(:read_from)
|
79
78
|
end
|
80
79
|
end
|
81
80
|
|
@@ -84,7 +83,7 @@ describe Rake::Funnel::Integration::TeamCity::NUnitPlugin do
|
|
84
83
|
let(:which) { nil }
|
85
84
|
|
86
85
|
it 'should skip reading the version' do
|
87
|
-
expect(BinaryVersionReader).not_to have_received(:read_from)
|
86
|
+
expect(Rake::Funnel::Support::BinaryVersionReader).not_to have_received(:read_from)
|
88
87
|
end
|
89
88
|
end
|
90
89
|
|
@@ -106,7 +105,7 @@ describe Rake::Funnel::Integration::TeamCity::NUnitPlugin do
|
|
106
105
|
context 'plugin for NUnit version not available' do
|
107
106
|
let(:env_var) { '/path/to/nunit plugins/nunit' }
|
108
107
|
let(:which) { 'path/to/nunit-console.exe' }
|
109
|
-
let(:nunit_version) { VersionInfo.new(file_version: '1.2.3.4') }
|
108
|
+
let(:nunit_version) { Rake::Funnel::Support::VersionInfo.new(file_version: '1.2.3.4') }
|
110
109
|
|
111
110
|
it 'should report that the addin version is not available' do
|
112
111
|
expect(Rake).to \
|
@@ -1,25 +1,21 @@
|
|
1
1
|
# rubocop:disable RSpec/FilePath
|
2
2
|
|
3
|
-
include Rake
|
4
|
-
include Rake::Funnel::Integration
|
5
|
-
include Rake::Funnel::Integration::TeamCity
|
6
|
-
|
7
3
|
describe Rake::Funnel::Integration::TeamCity::ProgressReport do
|
8
|
-
include DSL
|
4
|
+
include Rake::DSL
|
9
5
|
|
10
6
|
let(:teamcity_running?) { false }
|
11
7
|
let(:teamcity_rake_runner?) { false }
|
12
8
|
|
13
9
|
before do
|
14
|
-
allow(TeamCity).to receive(:running?).and_return(teamcity_running?)
|
15
|
-
allow(TeamCity).to receive(:rake_runner?).and_return(teamcity_rake_runner?)
|
16
|
-
allow(ServiceMessages).to receive(:block_opened)
|
17
|
-
allow(ServiceMessages).to receive(:block_closed)
|
18
|
-
allow(ServiceMessages).to receive(:progress_start)
|
19
|
-
allow(ServiceMessages).to receive(:progress_finish)
|
20
|
-
allow(ServiceMessages).to receive(:build_problem)
|
21
|
-
|
22
|
-
Task.clear
|
10
|
+
allow(Rake::Funnel::Integration::TeamCity).to receive(:running?).and_return(teamcity_running?)
|
11
|
+
allow(Rake::Funnel::Integration::TeamCity).to receive(:rake_runner?).and_return(teamcity_rake_runner?)
|
12
|
+
allow(Rake::Funnel::Integration::TeamCity::ServiceMessages).to receive(:block_opened)
|
13
|
+
allow(Rake::Funnel::Integration::TeamCity::ServiceMessages).to receive(:block_closed)
|
14
|
+
allow(Rake::Funnel::Integration::TeamCity::ServiceMessages).to receive(:progress_start)
|
15
|
+
allow(Rake::Funnel::Integration::TeamCity::ServiceMessages).to receive(:progress_finish)
|
16
|
+
allow(Rake::Funnel::Integration::TeamCity::ServiceMessages).to receive(:build_problem)
|
17
|
+
|
18
|
+
Rake::Task.clear
|
23
19
|
end
|
24
20
|
|
25
21
|
subject! do
|
@@ -32,21 +28,25 @@ describe Rake::Funnel::Integration::TeamCity::ProgressReport do
|
|
32
28
|
|
33
29
|
shared_examples :block_report do
|
34
30
|
it 'should write block start' do
|
35
|
-
expect(ServiceMessages).to
|
31
|
+
expect(Rake::Funnel::Integration::TeamCity::ServiceMessages).to \
|
32
|
+
have_received(:block_opened).with(name: 'task')
|
36
33
|
end
|
37
34
|
|
38
35
|
it 'should write block end' do
|
39
|
-
expect(ServiceMessages).to
|
36
|
+
expect(Rake::Funnel::Integration::TeamCity::ServiceMessages).to \
|
37
|
+
have_received(:block_closed).with(name: 'task')
|
40
38
|
end
|
41
39
|
end
|
42
40
|
|
43
41
|
shared_examples :no_block_report do
|
44
42
|
it 'should not write block start' do
|
45
|
-
expect(ServiceMessages).not_to
|
43
|
+
expect(Rake::Funnel::Integration::TeamCity::ServiceMessages).not_to \
|
44
|
+
have_received(:block_opened)
|
46
45
|
end
|
47
46
|
|
48
47
|
it 'should not write block end' do
|
49
|
-
expect(ServiceMessages).not_to
|
48
|
+
expect(Rake::Funnel::Integration::TeamCity::ServiceMessages).not_to \
|
49
|
+
have_received(:block_closed)
|
50
50
|
end
|
51
51
|
end
|
52
52
|
|
@@ -54,11 +54,12 @@ describe Rake::Funnel::Integration::TeamCity::ProgressReport do
|
|
54
54
|
before do
|
55
55
|
task :task
|
56
56
|
|
57
|
-
Task[:task].invoke
|
57
|
+
Rake::Task[:task].invoke
|
58
58
|
end
|
59
59
|
|
60
60
|
it 'should not report build problems' do
|
61
|
-
expect(ServiceMessages).not_to
|
61
|
+
expect(Rake::Funnel::Integration::TeamCity::ServiceMessages).not_to \
|
62
|
+
have_received(:build_problem)
|
62
63
|
end
|
63
64
|
|
64
65
|
context 'not on TeamCity' do
|
@@ -103,8 +104,8 @@ describe Rake::Funnel::Integration::TeamCity::ProgressReport do
|
|
103
104
|
end
|
104
105
|
|
105
106
|
begin
|
106
|
-
Task[:task].invoke
|
107
|
-
rescue ApplicationAbortedException, SpecificError => e
|
107
|
+
Rake::Task[:task].invoke
|
108
|
+
rescue Rake::ApplicationAbortedException, SpecificError => e
|
108
109
|
@raised_error = e
|
109
110
|
end
|
110
111
|
end
|
@@ -122,17 +123,18 @@ describe Rake::Funnel::Integration::TeamCity::ProgressReport do
|
|
122
123
|
|
123
124
|
describe 'build problems' do
|
124
125
|
it 'should report build problems' do
|
125
|
-
expect(ServiceMessages).to
|
126
|
+
expect(Rake::Funnel::Integration::TeamCity::ServiceMessages).to \
|
127
|
+
have_received(:build_problem)
|
126
128
|
end
|
127
129
|
|
128
130
|
it 'should report the error message' do
|
129
|
-
expect(ServiceMessages).to \
|
131
|
+
expect(Rake::Funnel::Integration::TeamCity::ServiceMessages).to \
|
130
132
|
have_received(:build_problem)
|
131
133
|
.with(hash_including(description: be_an_instance_of(String)))
|
132
134
|
end
|
133
135
|
|
134
136
|
it 'should report the first 4000 characters of the error message' do
|
135
|
-
expect(ServiceMessages).to \
|
137
|
+
expect(Rake::Funnel::Integration::TeamCity::ServiceMessages).to \
|
136
138
|
have_received(:build_problem)
|
137
139
|
.with(hash_including(description: have(4000).items))
|
138
140
|
end
|
@@ -142,18 +144,19 @@ describe Rake::Funnel::Integration::TeamCity::ProgressReport do
|
|
142
144
|
it_behaves_like :block_report
|
143
145
|
|
144
146
|
it 'should report the error as a build problem' do
|
145
|
-
expect(ServiceMessages).to
|
147
|
+
expect(Rake::Funnel::Integration::TeamCity::ServiceMessages).to \
|
148
|
+
have_received(:build_problem)
|
146
149
|
end
|
147
150
|
end
|
148
151
|
|
149
152
|
context 'with rake runner' do
|
150
153
|
let(:teamcity_rake_runner?) { true }
|
151
154
|
let(:error) do
|
152
|
-
ApplicationAbortedException.new(SpecificError.new('inner message'))
|
155
|
+
Rake::ApplicationAbortedException.new(SpecificError.new('inner message'))
|
153
156
|
end
|
154
157
|
|
155
158
|
it 'should report the inner error as a build problem (as it will be wrapped in a ApplicationAbortedException)' do # rubocop:disable Metrics/LineLength
|
156
|
-
expect(ServiceMessages).to \
|
159
|
+
expect(Rake::Funnel::Integration::TeamCity::ServiceMessages).to \
|
157
160
|
have_received(:build_problem).with(description: 'inner message')
|
158
161
|
end
|
159
162
|
|
@@ -170,11 +173,12 @@ describe Rake::Funnel::Integration::TeamCity::ProgressReport do
|
|
170
173
|
|
171
174
|
task :task
|
172
175
|
|
173
|
-
Task[:task].invoke
|
176
|
+
Rake::Task[:task].invoke
|
174
177
|
end
|
175
178
|
|
176
179
|
it 'should not write' do
|
177
|
-
expect(ServiceMessages).not_to
|
180
|
+
expect(Rake::Funnel::Integration::TeamCity::ServiceMessages).not_to \
|
181
|
+
have_received(:block_opened)
|
178
182
|
end
|
179
183
|
end
|
180
184
|
end
|
@@ -1,10 +1,8 @@
|
|
1
1
|
# rubocop:disable RSpec/FilePath
|
2
2
|
|
3
|
-
include Rake::Funnel::Integration
|
4
|
-
|
5
3
|
describe Rake::Funnel::Integration::TeamCity::ServiceMessages do
|
6
4
|
before do
|
7
|
-
allow(TeamCity).to receive(:running?).and_return(teamcity_running?)
|
5
|
+
allow(Rake::Funnel::Integration::TeamCity).to receive(:running?).and_return(teamcity_running?)
|
8
6
|
allow($stdout).to receive(:puts)
|
9
7
|
end
|
10
8
|
|
@@ -1,9 +1,7 @@
|
|
1
1
|
# rubocop:disable RSpec/FilePath
|
2
2
|
|
3
|
-
include Rake::Funnel::Support
|
4
|
-
|
5
3
|
describe Rake::Funnel::Support::Mapper::Styles::MSDeploy do
|
6
|
-
subject { Mapper.new(:MSDeploy) }
|
4
|
+
subject { Rake::Funnel::Support::Mapper.new(:MSDeploy) }
|
7
5
|
|
8
6
|
describe 'no arguments' do
|
9
7
|
it 'should convert no args to []' do
|
@@ -1,14 +1,12 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
Styles.constants.reject { |x| x == :MSDeploy }.each do |style|
|
4
|
-
style_path = Styles.const_get(style)
|
1
|
+
Rake::Funnel::Support::ArgumentMapper::Styles.constants.reject { |x| x == :MSDeploy }.each do |style|
|
2
|
+
style_path = Rake::Funnel::Support::ArgumentMapper::Styles.const_get(style)
|
5
3
|
describe style_path do
|
6
4
|
subject do
|
7
|
-
Mapper.new(style)
|
5
|
+
Rake::Funnel::Support::Mapper.new(style)
|
8
6
|
end
|
9
7
|
|
10
8
|
let(:style) do
|
11
|
-
Styles.const_get(style).new
|
9
|
+
Rake::Funnel::Support::ArgumentMapper::Styles.const_get(style).new
|
12
10
|
end
|
13
11
|
|
14
12
|
def styled(switch, key = nil, value = nil) # rubocop:disable Metrics/MethodLength, Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity, Metrics/LineLength
|
@@ -1,5 +1,3 @@
|
|
1
|
-
include Rake::Funnel::Support
|
2
|
-
|
3
1
|
describe Rake::Funnel::Support::AssemblyVersion::FromVersionFiles do
|
4
2
|
describe 'defaults' do
|
5
3
|
its(:search_pattern) { should == %w(**/VERSION) }
|
@@ -26,16 +24,17 @@ describe Rake::Funnel::Support::AssemblyVersion::FromVersionFiles do
|
|
26
24
|
end
|
27
25
|
|
28
26
|
describe 'enumeration' do
|
29
|
-
let(:finder) { instance_double(Finder).as_null_object }
|
27
|
+
let(:finder) { instance_double(Rake::Funnel::Support::Finder).as_null_object }
|
30
28
|
let(:files) { %w(1 2) }
|
31
29
|
|
32
30
|
before do
|
33
31
|
allow(finder).to receive(:all_or_default).and_return(files)
|
34
|
-
allow(Finder).to receive(:new).and_return(finder)
|
32
|
+
allow(Rake::Funnel::Support::Finder).to receive(:new).and_return(finder)
|
35
33
|
end
|
36
34
|
|
37
35
|
before do
|
38
|
-
allow(VersionInfo).to
|
36
|
+
allow(Rake::Funnel::Support::VersionInfo).to \
|
37
|
+
receive(:read_version_from).and_return(*files)
|
39
38
|
end
|
40
39
|
|
41
40
|
before do
|
@@ -50,11 +49,11 @@ describe Rake::Funnel::Support::AssemblyVersion::FromVersionFiles do
|
|
50
49
|
args = files.map do |file|
|
51
50
|
{
|
52
51
|
source: file,
|
53
|
-
version_info: VersionInfo.parse(version: file, metadata: {
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
52
|
+
version_info: Rake::Funnel::Support::VersionInfo.parse(version: file, metadata: {
|
53
|
+
pre: subject.metadata[:pre],
|
54
|
+
build: subject.metadata[:build],
|
55
|
+
sha: subject.metadata[:sha]
|
56
|
+
})
|
58
57
|
}
|
59
58
|
end
|
60
59
|
|