rake-funnel 0.3.2.pre → 0.4.0.pre

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.
Files changed (122) hide show
  1. checksums.yaml +4 -4
  2. data/.rspec +2 -2
  3. data/Gemfile +4 -0
  4. data/README.md +2 -2
  5. data/lib/rake/funnel/ambiguous_file_error.rb +31 -29
  6. data/lib/rake/funnel/execution_error.rb +28 -26
  7. data/lib/rake/funnel/extensions/case/camel_case.rb +24 -19
  8. data/lib/rake/funnel/extensions/case/pascal_case.rb +24 -19
  9. data/lib/rake/funnel/extensions/case.rb +3 -3
  10. data/lib/rake/funnel/extensions/common_path.rb +60 -52
  11. data/lib/rake/funnel/extensions/disable_colors.rb +33 -27
  12. data/lib/rake/funnel/extensions/rexml.rb +27 -23
  13. data/lib/rake/funnel/extensions/shell.rb +92 -56
  14. data/lib/rake/funnel/extensions/windows_path.rb +15 -11
  15. data/lib/rake/funnel/framework.rb +11 -16
  16. data/lib/rake/funnel/integration/progress_report.rb +72 -70
  17. data/lib/rake/funnel/integration/sync_output.rb +12 -8
  18. data/lib/rake/funnel/integration/teamcity/nunit_plugin.rb +61 -55
  19. data/lib/rake/funnel/integration/teamcity/progress_report.rb +39 -33
  20. data/lib/rake/funnel/integration/teamcity/service_messages.rb +46 -40
  21. data/lib/rake/funnel/integration/teamcity/teamcity.rb +19 -15
  22. data/lib/rake/funnel/integration/teamcity.rb +3 -5
  23. data/lib/rake/funnel/support/argument_mapper/key_value_pair.rb +16 -10
  24. data/lib/rake/funnel/support/argument_mapper/styles/default.rb +39 -31
  25. data/lib/rake/funnel/support/argument_mapper/styles/msbuild.rb +41 -33
  26. data/lib/rake/funnel/support/argument_mapper/styles/msdeploy.rb +55 -47
  27. data/lib/rake/funnel/support/argument_mapper/styles/nunit.rb +41 -33
  28. data/lib/rake/funnel/support/argument_mapper/styles.rb +3 -5
  29. data/lib/rake/funnel/support/argument_mapper/switch.rb +16 -10
  30. data/lib/rake/funnel/support/argument_mapper/value.rb +16 -10
  31. data/lib/rake/funnel/support/assembly_version/from_version_files.rb +39 -35
  32. data/lib/rake/funnel/support/assembly_version/languages/cs +5 -5
  33. data/lib/rake/funnel/support/assembly_version/languages/fs +12 -12
  34. data/lib/rake/funnel/support/assembly_version/languages/vb +5 -5
  35. data/lib/rake/funnel/support/assembly_version_writer.rb +56 -52
  36. data/lib/rake/funnel/support/binary_version_reader.rb +37 -32
  37. data/lib/rake/funnel/support/copier.rb +31 -27
  38. data/lib/rake/funnel/support/environments/loader.rb +46 -40
  39. data/lib/rake/funnel/support/environments.rb +3 -3
  40. data/lib/rake/funnel/support/internal/finder.rb +55 -51
  41. data/lib/rake/funnel/support/internal/instantiate_symbol.rb +38 -34
  42. data/lib/rake/funnel/support/mapper.rb +57 -53
  43. data/lib/rake/funnel/support/mono.rb +21 -17
  44. data/lib/rake/funnel/support/msbuild/build_tool.rb +30 -24
  45. data/lib/rake/funnel/support/msbuild.rb +3 -3
  46. data/lib/rake/funnel/support/msdeploy/registry_patch.rb +90 -84
  47. data/lib/rake/funnel/support/msdeploy.rb +3 -3
  48. data/lib/rake/funnel/support/patch.rb +41 -37
  49. data/lib/rake/funnel/support/specs_remover.rb +66 -62
  50. data/lib/rake/funnel/support/template_engine.rb +30 -26
  51. data/lib/rake/funnel/support/timing/report.rb +95 -89
  52. data/lib/rake/funnel/support/timing/statistics.rb +32 -26
  53. data/lib/rake/funnel/support/timing.rb +3 -3
  54. data/lib/rake/funnel/support/version_info.rb +103 -72
  55. data/lib/rake/funnel/support/which.rb +19 -15
  56. data/lib/rake/funnel/support/zipper.rb +53 -49
  57. data/lib/rake/funnel/tasks/assembly_version.rb +44 -40
  58. data/lib/rake/funnel/tasks/bin_path.rb +45 -41
  59. data/lib/rake/funnel/tasks/copy.rb +43 -39
  60. data/lib/rake/funnel/tasks/environments.rb +89 -89
  61. data/lib/rake/funnel/tasks/msbuild.rb +55 -51
  62. data/lib/rake/funnel/tasks/msdeploy.rb +54 -50
  63. data/lib/rake/funnel/tasks/nunit.rb +52 -48
  64. data/lib/rake/funnel/tasks/paket.rb +51 -47
  65. data/lib/rake/funnel/tasks/quick_template.rb +53 -49
  66. data/lib/rake/funnel/tasks/side_by_side_specs.rb +41 -37
  67. data/lib/rake/funnel/tasks/timing.rb +108 -104
  68. data/lib/rake/funnel/tasks/zip.rb +46 -42
  69. data/lib/rake/funnel/version.rb +1 -1
  70. data/lib/rake/funnel.rb +7 -7
  71. data/rake-funnel.gemspec +12 -3
  72. data/spec/rake/funnel/execution_error_spec.rb +67 -67
  73. data/spec/rake/funnel/extensions/case/camel_case_spec.rb +17 -17
  74. data/spec/rake/funnel/extensions/case/pascal_case_spec.rb +17 -17
  75. data/spec/rake/funnel/extensions/common_path_spec.rb +56 -56
  76. data/spec/rake/funnel/extensions/disable_colors_spec.rb +33 -33
  77. data/spec/rake/funnel/extensions/rexml_spec.rb +20 -20
  78. data/spec/rake/funnel/extensions/shell_spec.rb +237 -237
  79. data/spec/rake/funnel/extensions/windows_path_spec.rb +5 -5
  80. data/spec/rake/funnel/integration/progress_report_spec.rb +149 -149
  81. data/spec/rake/funnel/integration/sync_output_spec.rb +16 -16
  82. data/spec/rake/funnel/integration/teamcity/nunit_plugin_spec.rb +110 -110
  83. data/spec/rake/funnel/integration/teamcity/progress_report_spec.rb +174 -174
  84. data/spec/rake/funnel/integration/teamcity/service_messages_spec.rb +136 -136
  85. data/spec/rake/funnel/integration/teamcity/teamcity_spec.rb +34 -34
  86. data/spec/rake/funnel/support/argument_mapper/styles/msdeploy_spec.rb +222 -222
  87. data/spec/rake/funnel/support/argument_mapper/styles/nunit_spec.rb +25 -25
  88. data/spec/rake/funnel/support/argument_mapper/styles/styles_spec.rb +214 -214
  89. data/spec/rake/funnel/support/assembly_version/from_version_files_spec.rb +66 -61
  90. data/spec/rake/funnel/support/assembly_version_writer_spec.rb +140 -140
  91. data/spec/rake/funnel/support/binary_version_reader_spec.rb +29 -29
  92. data/spec/rake/funnel/support/copier_spec.rb +58 -58
  93. data/spec/rake/funnel/support/environments/loader_spec.rb +143 -143
  94. data/spec/rake/funnel/support/internal/finder_spec.rb +229 -229
  95. data/spec/rake/funnel/support/internal/instantiate_symbol_spec.rb +182 -183
  96. data/spec/rake/funnel/support/mapper_spec.rb +87 -87
  97. data/spec/rake/funnel/support/mono_spec.rb +57 -57
  98. data/spec/rake/funnel/support/msbuild/build_tool_spec.rb +21 -21
  99. data/spec/rake/funnel/support/msdeploy/registry_patch_spec.rb +139 -139
  100. data/spec/rake/funnel/support/patch_spec.rb +108 -108
  101. data/spec/rake/funnel/support/specs_remover/Sample.csproj +28 -28
  102. data/spec/rake/funnel/support/specs_remover_spec.rb +116 -116
  103. data/spec/rake/funnel/support/template_engine_spec.rb +65 -65
  104. data/spec/rake/funnel/support/timing/report_spec.rb +129 -129
  105. data/spec/rake/funnel/support/version_info_spec.rb +333 -228
  106. data/spec/rake/funnel/support/which_spec.rb +65 -65
  107. data/spec/rake/funnel/support/zipper_spec.rb +77 -77
  108. data/spec/rake/funnel/tasks/assembly_version_spec.rb +45 -45
  109. data/spec/rake/funnel/tasks/bin_path_spec.rb +52 -52
  110. data/spec/rake/funnel/tasks/copy_spec.rb +44 -44
  111. data/spec/rake/funnel/tasks/environments_spec.rb +249 -247
  112. data/spec/rake/funnel/tasks/msbuild_spec.rb +91 -91
  113. data/spec/rake/funnel/tasks/msdeploy_spec.rb +220 -220
  114. data/spec/rake/funnel/tasks/nunit_spec.rb +74 -74
  115. data/spec/rake/funnel/tasks/paket_spec.rb +140 -142
  116. data/spec/rake/funnel/tasks/quick_template_spec.rb +62 -62
  117. data/spec/rake/funnel/tasks/side_by_side_specs_spec.rb +58 -58
  118. data/spec/rake/funnel/tasks/timing_spec.rb +133 -133
  119. data/spec/rake/funnel/tasks/zip_spec.rb +50 -50
  120. data/spec/spec_helper.rb +43 -33
  121. metadata +2 -3
  122. data/lib/rake/funnel/support/side_by_side_specs.rb +0 -3
@@ -1,237 +1,237 @@
1
- require 'open3'
2
-
3
- include Rake::Funnel
4
-
5
- describe Rake::Funnel::Extensions::Shell do
6
- before {
7
- allow(Open3).to receive(:popen2e).and_yield(nil, stdout_and_stderr, exit)
8
-
9
- allow($stdout).to receive(:puts)
10
- allow($stderr).to receive(:puts)
11
- allow(Rake).to receive(:rake_output_message)
12
- }
13
-
14
- let(:exit) { OpenStruct.new(value: OpenStruct.new(success?: true, exitstatus: 0)) }
15
-
16
- let(:stdout_and_stderr) { StringIO.new("output 1\noutput 2\n") }
17
-
18
- subject { Object.new.extend(described_class) }
19
-
20
- after { stdout_and_stderr.close }
21
-
22
- describe 'command' do
23
- it 'should accept simple commands' do
24
- arg = 'simple'
25
-
26
- subject.shell(arg)
27
-
28
- expect(Open3).to have_received(:popen2e).with(arg)
29
- end
30
-
31
- it 'should accept commands with arguments as array' do
32
- args = %w(simple 1 2)
33
-
34
- subject.shell(args)
35
-
36
- expect(Open3).to have_received(:popen2e).with(*args)
37
- end
38
-
39
- it 'should accept commands with arguments' do
40
- subject.shell('1', 2)
41
-
42
- expect(Open3).to have_received(:popen2e).with('1', 2)
43
- end
44
-
45
- it 'should reject nil' do
46
- subject.shell(1, nil)
47
-
48
- expect(Open3).to have_received(:popen2e).with(1)
49
- end
50
-
51
- it 'should accept nested arrays' do
52
- subject.shell([1, 2, [3]])
53
-
54
- expect(Open3).to have_received(:popen2e).with(1, 2, 3)
55
- end
56
-
57
- it 'should reject nested nils' do
58
- subject.shell([1, nil, [3]])
59
-
60
- expect(Open3).to have_received(:popen2e).with(1, 3)
61
- end
62
-
63
- it 'should echo the command' do
64
- arg = '1', 2
65
-
66
- subject.shell(arg)
67
-
68
- expect(Rake).to have_received(:rake_output_message).with(arg.join(' '))
69
- end
70
- end
71
-
72
- it 'should return nil' do
73
- expect(subject.shell('foo')).to be_nil
74
- end
75
-
76
- describe 'output redirection' do
77
- before { subject.shell('foo') }
78
-
79
- it 'should redirect command output to stdout' do
80
- expect($stdout).to have_received(:puts).with(/output 1/)
81
- expect($stdout).to have_received(:puts).with(/output 2/)
82
- end
83
-
84
- it 'should colorize lines' do
85
- expect($stdout).to have_received(:puts).with('output 1'.green)
86
- end
87
- end
88
-
89
- describe 'log file' do
90
- before {
91
- allow(subject).to receive(:mkdir_p)
92
- allow(File).to receive(:open)
93
- }
94
-
95
- let(:log_file) { nil }
96
-
97
- before { subject.shell('foo', log_file: log_file) }
98
-
99
- context 'no log file' do
100
- it 'should not create path to log file' do
101
- expect(subject).to_not have_received(:mkdir_p)
102
- end
103
-
104
- it 'should not write log file' do
105
- expect(subject).to_not have_received(:mkdir_p)
106
- expect(File).to_not have_received(:open)
107
- end
108
- end
109
-
110
- context 'with log file' do
111
- let(:log_file) { 'tmp/log.txt' }
112
-
113
- it 'should create path to log file' do
114
- expect(subject).to have_received(:mkdir_p).with(File.dirname(log_file))
115
- end
116
-
117
- it 'should append to log file' do
118
- expect(File).to have_received(:open).with(log_file, 'a').at_least(:once)
119
- end
120
- end
121
- end
122
-
123
- describe 'error detection' do
124
- let(:error_lines) { /error/ }
125
-
126
- before {
127
- begin
128
- subject.shell('foo', error_lines: error_lines)
129
- rescue ExecutionError
130
- end
131
- }
132
-
133
- context 'no lines indicating errors' do
134
- it 'should not log to stderr' do
135
- expect($stderr).to_not have_received(:puts)
136
- end
137
- end
138
-
139
- context 'lines indicating errors' do
140
- let(:stdout_and_stderr) { StringIO.new("output 1\nerror\noutput 2\n") }
141
-
142
- it 'should log to stdout before error' do
143
- expect($stdout).to have_received(:puts).with(/output 1/)
144
- end
145
-
146
- it 'should log to stderr on error' do
147
- expect($stderr).to have_received(:puts).with(/error/)
148
- end
149
-
150
- it 'should not log to stdout on error' do
151
- expect($stdout).to_not have_received(:puts).with(/error/)
152
- end
153
-
154
- it 'should colorize error lines' do
155
- expect($stderr).to have_received(:puts).with('error'.bold.red)
156
- end
157
-
158
- it 'should log to stdout after error' do
159
- expect($stdout).to have_received(:puts).with(/output 2/)
160
- end
161
- end
162
- end
163
-
164
- describe 'callback block' do
165
- it 'should yield' do
166
- expect { |b| subject.shell('foo', &b) }.to yield_control
167
- end
168
-
169
- it 'should yield the success status' do
170
- expect { |b| subject.shell('foo', &b) }.to yield_with_args(true, be, be, be)
171
- end
172
-
173
- it 'should yield the command' do
174
- expect { |b| subject.shell('foo', &b) }.to yield_with_args(be, 'foo', be, be)
175
- end
176
-
177
- it 'should yield the exit code' do
178
- expect { |b| subject.shell('foo', &b) }.to yield_with_args(be, be, 0, be)
179
- end
180
-
181
- it 'should yield the log' do
182
- expect { |b| subject.shell('foo', &b) }.to yield_with_args(be, be, be, /output/)
183
- end
184
- end
185
-
186
- describe 'failure' do
187
- context 'error lines logged' do
188
- context 'without block' do
189
- it 'should fail' do
190
- expect { subject.shell('foo', error_lines: /.*/) }.to raise_error(ExecutionError)
191
- end
192
- end
193
-
194
- context 'with block' do
195
- it 'should not fail' do
196
- expect { subject.shell('foo', error_lines: /.*/) {} }.not_to raise_error
197
- end
198
-
199
- it 'should yield the error' do
200
- expect { |b| subject.shell('foo', error_lines: /.*/, &b) }.to yield_with_args(false, 'foo', 0, /output/)
201
- end
202
- end
203
- end
204
-
205
- context 'error exit' do
206
- let(:exit) { OpenStruct.new(value: OpenStruct.new(success?: false, exitstatus: 1)) }
207
-
208
- context 'without block' do
209
- it 'should fail' do
210
- expect { subject.shell('foo') }.to raise_error(ExecutionError)
211
- end
212
-
213
- it 'should report the exit code' do
214
- expect { subject.shell('foo') }.to raise_error { |e| expect(e.exit_code).to eq(exit.value.exitstatus) }
215
- end
216
-
217
- it 'should report the command that was run' do
218
- expect { subject.shell('foo') }.to raise_error { |e| expect(e.command).to eq('foo') }
219
- end
220
-
221
- it 'should report logged lines' do
222
- expect { subject.shell('foo') }.to raise_error { |e| expect(e.output).to eq(stdout_and_stderr.string) }
223
- end
224
- end
225
-
226
- context 'with block' do
227
- it 'should not fail' do
228
- expect { subject.shell('foo') {} }.not_to raise_error
229
- end
230
-
231
- it 'should yield the error' do
232
- expect { |b| subject.shell('foo', error_lines: /.*/, &b) }.to yield_with_args(false, 'foo', 1, /output/)
233
- end
234
- end
235
- end
236
- end
237
- end
1
+ require 'open3'
2
+
3
+ include Rake::Funnel
4
+
5
+ describe Rake::Funnel::Extensions::Shell do
6
+ before {
7
+ allow(Open3).to receive(:popen2e).and_yield(nil, stdout_and_stderr, exit)
8
+
9
+ allow($stdout).to receive(:puts)
10
+ allow($stderr).to receive(:puts)
11
+ allow(Rake).to receive(:rake_output_message)
12
+ }
13
+
14
+ let(:exit) { OpenStruct.new(value: OpenStruct.new(success?: true, exitstatus: 0)) }
15
+
16
+ let(:stdout_and_stderr) { StringIO.new("output 1\noutput 2\n") }
17
+
18
+ subject { Object.new.extend(described_class) }
19
+
20
+ after { stdout_and_stderr.close }
21
+
22
+ describe 'command' do
23
+ it 'should accept simple commands' do
24
+ arg = 'simple'
25
+
26
+ subject.shell(arg)
27
+
28
+ expect(Open3).to have_received(:popen2e).with(arg)
29
+ end
30
+
31
+ it 'should accept commands with arguments as array' do
32
+ args = %w(simple 1 2)
33
+
34
+ subject.shell(args)
35
+
36
+ expect(Open3).to have_received(:popen2e).with(*args)
37
+ end
38
+
39
+ it 'should accept commands with arguments' do
40
+ subject.shell('1', 2)
41
+
42
+ expect(Open3).to have_received(:popen2e).with('1', 2)
43
+ end
44
+
45
+ it 'should reject nil' do
46
+ subject.shell(1, nil)
47
+
48
+ expect(Open3).to have_received(:popen2e).with(1)
49
+ end
50
+
51
+ it 'should accept nested arrays' do
52
+ subject.shell([1, 2, [3]])
53
+
54
+ expect(Open3).to have_received(:popen2e).with(1, 2, 3)
55
+ end
56
+
57
+ it 'should reject nested nils' do
58
+ subject.shell([1, nil, [3]])
59
+
60
+ expect(Open3).to have_received(:popen2e).with(1, 3)
61
+ end
62
+
63
+ it 'should echo the command' do
64
+ arg = '1', 2
65
+
66
+ subject.shell(arg)
67
+
68
+ expect(Rake).to have_received(:rake_output_message).with(arg.join(' '))
69
+ end
70
+ end
71
+
72
+ it 'should return nil' do
73
+ expect(subject.shell('foo')).to be_nil
74
+ end
75
+
76
+ describe 'output redirection' do
77
+ before { subject.shell('foo') }
78
+
79
+ it 'should redirect command output to stdout' do
80
+ expect($stdout).to have_received(:puts).with(/output 1/)
81
+ expect($stdout).to have_received(:puts).with(/output 2/)
82
+ end
83
+
84
+ it 'should colorize lines' do
85
+ expect($stdout).to have_received(:puts).with('output 1'.green)
86
+ end
87
+ end
88
+
89
+ describe 'log file' do
90
+ before {
91
+ allow(subject).to receive(:mkdir_p)
92
+ allow(File).to receive(:open)
93
+ }
94
+
95
+ let(:log_file) { nil }
96
+
97
+ before { subject.shell('foo', log_file: log_file) }
98
+
99
+ context 'no log file' do
100
+ it 'should not create path to log file' do
101
+ expect(subject).to_not have_received(:mkdir_p)
102
+ end
103
+
104
+ it 'should not write log file' do
105
+ expect(subject).to_not have_received(:mkdir_p)
106
+ expect(File).to_not have_received(:open)
107
+ end
108
+ end
109
+
110
+ context 'with log file' do
111
+ let(:log_file) { 'tmp/log.txt' }
112
+
113
+ it 'should create path to log file' do
114
+ expect(subject).to have_received(:mkdir_p).with(File.dirname(log_file))
115
+ end
116
+
117
+ it 'should append to log file' do
118
+ expect(File).to have_received(:open).with(log_file, 'a').at_least(:once)
119
+ end
120
+ end
121
+ end
122
+
123
+ describe 'error detection' do
124
+ let(:error_lines) { /error/ }
125
+
126
+ before {
127
+ begin
128
+ subject.shell('foo', error_lines: error_lines)
129
+ rescue ExecutionError
130
+ end
131
+ }
132
+
133
+ context 'no lines indicating errors' do
134
+ it 'should not log to stderr' do
135
+ expect($stderr).to_not have_received(:puts)
136
+ end
137
+ end
138
+
139
+ context 'lines indicating errors' do
140
+ let(:stdout_and_stderr) { StringIO.new("output 1\nerror\noutput 2\n") }
141
+
142
+ it 'should log to stdout before error' do
143
+ expect($stdout).to have_received(:puts).with(/output 1/)
144
+ end
145
+
146
+ it 'should log to stderr on error' do
147
+ expect($stderr).to have_received(:puts).with(/error/)
148
+ end
149
+
150
+ it 'should not log to stdout on error' do
151
+ expect($stdout).to_not have_received(:puts).with(/error/)
152
+ end
153
+
154
+ it 'should colorize error lines' do
155
+ expect($stderr).to have_received(:puts).with('error'.bold.red)
156
+ end
157
+
158
+ it 'should log to stdout after error' do
159
+ expect($stdout).to have_received(:puts).with(/output 2/)
160
+ end
161
+ end
162
+ end
163
+
164
+ describe 'callback block' do
165
+ it 'should yield' do
166
+ expect { |b| subject.shell('foo', &b) }.to yield_control
167
+ end
168
+
169
+ it 'should yield the success status' do
170
+ expect { |b| subject.shell('foo', &b) }.to yield_with_args(true, anything, anything, anything)
171
+ end
172
+
173
+ it 'should yield the command' do
174
+ expect { |b| subject.shell('foo', &b) }.to yield_with_args(anything, 'foo', anything, anything)
175
+ end
176
+
177
+ it 'should yield the exit code' do
178
+ expect { |b| subject.shell('foo', &b) }.to yield_with_args(anything, anything, 0, anything)
179
+ end
180
+
181
+ it 'should yield the log' do
182
+ expect { |b| subject.shell('foo', &b) }.to yield_with_args(anything, anything, anything, /output/)
183
+ end
184
+ end
185
+
186
+ describe 'failure' do
187
+ context 'error lines logged' do
188
+ context 'without block' do
189
+ it 'should fail' do
190
+ expect { subject.shell('foo', error_lines: /.*/) }.to raise_error(ExecutionError)
191
+ end
192
+ end
193
+
194
+ context 'with block' do
195
+ it 'should not fail' do
196
+ expect { subject.shell('foo', error_lines: /.*/) {} }.not_to raise_error
197
+ end
198
+
199
+ it 'should yield the error' do
200
+ expect { |b| subject.shell('foo', error_lines: /.*/, &b) }.to yield_with_args(false, 'foo', 0, /output/)
201
+ end
202
+ end
203
+ end
204
+
205
+ context 'error exit' do
206
+ let(:exit) { OpenStruct.new(value: OpenStruct.new(success?: false, exitstatus: 1)) }
207
+
208
+ context 'without block' do
209
+ it 'should fail' do
210
+ expect { subject.shell('foo') }.to raise_error(ExecutionError)
211
+ end
212
+
213
+ it 'should report the exit code' do
214
+ expect { subject.shell('foo') }.to raise_error { |e| expect(e.exit_code).to eq(exit.value.exitstatus) }
215
+ end
216
+
217
+ it 'should report the command that was run' do
218
+ expect { subject.shell('foo') }.to raise_error { |e| expect(e.command).to eq('foo') }
219
+ end
220
+
221
+ it 'should report logged lines' do
222
+ expect { subject.shell('foo') }.to raise_error { |e| expect(e.output).to eq(stdout_and_stderr.string) }
223
+ end
224
+ end
225
+
226
+ context 'with block' do
227
+ it 'should not fail' do
228
+ expect { subject.shell('foo') {} }.not_to raise_error
229
+ end
230
+
231
+ it 'should yield the error' do
232
+ expect { |b| subject.shell('foo', error_lines: /.*/, &b) }.to yield_with_args(false, 'foo', 1, /output/)
233
+ end
234
+ end
235
+ end
236
+ end
237
+ end
@@ -1,5 +1,5 @@
1
- describe Rake::Funnel::Extensions::WindowsPath do
2
- it 'should convert forward slash to backslash' do
3
- expect('C:\Foo/bar/baz'.to_windows_path).to eq('C:\Foo\bar\baz')
4
- end
5
- end
1
+ describe Rake::Funnel::Extensions::WindowsPath do
2
+ it 'should convert forward slash to backslash' do
3
+ expect('C:\Foo/bar/baz'.to_windows_path).to eq('C:\Foo\bar\baz')
4
+ end
5
+ end