rake-funnel 0.18.0 → 0.19.0

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 (99) hide show
  1. checksums.yaml +4 -4
  2. data/.rspec +1 -0
  3. data/.simplecov +24 -0
  4. data/Gemfile +27 -19
  5. data/README.md +1 -1
  6. data/lib/rake/funnel/ambiguous_file_error.rb +1 -0
  7. data/lib/rake/funnel/execution_error.rb +1 -0
  8. data/lib/rake/funnel/extensions/common_path.rb +5 -4
  9. data/lib/rake/funnel/extensions/shell.rb +3 -2
  10. data/lib/rake/funnel/integration/progress_report.rb +3 -2
  11. data/lib/rake/funnel/integration/sync_output.rb +1 -0
  12. data/lib/rake/funnel/integration/teamcity/nunit_plugin.rb +2 -1
  13. data/lib/rake/funnel/integration/teamcity/progress_report.rb +1 -1
  14. data/lib/rake/funnel/integration/teamcity/service_messages.rb +8 -3
  15. data/lib/rake/funnel/integration/teamcity/teamcity.rb +5 -4
  16. data/lib/rake/funnel/support/argument_mapper/styles/default.rb +5 -4
  17. data/lib/rake/funnel/support/argument_mapper/styles/msbuild.rb +6 -5
  18. data/lib/rake/funnel/support/argument_mapper/styles/msdeploy.rb +13 -12
  19. data/lib/rake/funnel/support/argument_mapper/styles/nunit.rb +6 -5
  20. data/lib/rake/funnel/support/assembly_version/from_version_files.rb +2 -1
  21. data/lib/rake/funnel/support/assembly_version_writer.rb +1 -0
  22. data/lib/rake/funnel/support/binary_version_reader.rb +14 -7
  23. data/lib/rake/funnel/support/copier.rb +1 -0
  24. data/lib/rake/funnel/support/environments/loader.rb +13 -8
  25. data/lib/rake/funnel/support/internal/finder.rb +2 -1
  26. data/lib/rake/funnel/support/internal/instantiate_symbol.rb +9 -4
  27. data/lib/rake/funnel/support/mapper.rb +7 -6
  28. data/lib/rake/funnel/support/mono.rb +1 -3
  29. data/lib/rake/funnel/support/msbuild/build_tool.rb +35 -12
  30. data/lib/rake/funnel/support/msdeploy/registry_patch.rb +14 -17
  31. data/lib/rake/funnel/support/patch.rb +1 -0
  32. data/lib/rake/funnel/support/specs_remover.rb +14 -11
  33. data/lib/rake/funnel/support/template_engine.rb +1 -0
  34. data/lib/rake/funnel/support/timing/report.rb +11 -10
  35. data/lib/rake/funnel/support/version_info.rb +8 -9
  36. data/lib/rake/funnel/support/zipper.rb +1 -0
  37. data/lib/rake/funnel/tasks/assembly_version.rb +4 -3
  38. data/lib/rake/funnel/tasks/bin_path.rb +3 -2
  39. data/lib/rake/funnel/tasks/copy.rb +2 -1
  40. data/lib/rake/funnel/tasks/environments.rb +13 -9
  41. data/lib/rake/funnel/tasks/msbuild.rb +4 -6
  42. data/lib/rake/funnel/tasks/msdeploy.rb +6 -5
  43. data/lib/rake/funnel/tasks/nunit.rb +3 -2
  44. data/lib/rake/funnel/tasks/paket.rb +2 -1
  45. data/lib/rake/funnel/tasks/quick_template.rb +3 -2
  46. data/lib/rake/funnel/tasks/side_by_side_specs.rb +2 -1
  47. data/lib/rake/funnel/tasks/timing.rb +7 -6
  48. data/lib/rake/funnel/tasks/zip.rb +3 -2
  49. data/lib/rake/funnel/version.rb +1 -1
  50. data/rake-funnel.gemspec +11 -11
  51. data/spec/rake/funnel/execution_error_spec.rb +2 -2
  52. data/spec/rake/funnel/extensions/rexml_spec.rb +5 -2
  53. data/spec/rake/funnel/extensions/shell_spec.rb +26 -17
  54. data/spec/rake/funnel/integration/progress_report_spec.rb +32 -36
  55. data/spec/rake/funnel/integration/sync_output_spec.rb +5 -5
  56. data/spec/rake/funnel/integration/teamcity/nunit_plugin_spec.rb +32 -20
  57. data/spec/rake/funnel/integration/teamcity/progress_report_spec.rb +31 -25
  58. data/spec/rake/funnel/integration/teamcity/service_messages_spec.rb +56 -20
  59. data/spec/rake/funnel/integration/teamcity/teamcity_spec.rb +7 -5
  60. data/spec/rake/funnel/support/argument_mapper/styles/msdeploy_spec.rb +2 -0
  61. data/spec/rake/funnel/support/argument_mapper/styles/nunit_spec.rb +6 -4
  62. data/spec/rake/funnel/support/argument_mapper/styles/styles_spec.rb +76 -67
  63. data/spec/rake/funnel/support/assembly_version/from_version_files_spec.rb +17 -19
  64. data/spec/rake/funnel/support/assembly_version_writer_spec.rb +49 -52
  65. data/spec/rake/funnel/support/binary_version_reader_spec.rb +2 -2
  66. data/spec/rake/funnel/support/copier_spec.rb +5 -5
  67. data/spec/rake/funnel/support/environments/loader_spec.rb +32 -32
  68. data/spec/rake/funnel/support/internal/finder_spec.rb +8 -6
  69. data/spec/rake/funnel/support/internal/instantiate_symbol_spec.rb +27 -27
  70. data/spec/rake/funnel/support/mapper_spec.rb +4 -3
  71. data/spec/rake/funnel/support/mono_spec.rb +7 -7
  72. data/spec/rake/funnel/support/msbuild/build_tool_spec.rb +13 -10
  73. data/spec/rake/funnel/support/msdeploy/registry_patch_spec.rb +47 -41
  74. data/spec/rake/funnel/support/patch_spec.rb +11 -11
  75. data/spec/rake/funnel/support/specs_remover/project/paket.references +3 -3
  76. data/spec/rake/funnel/support/specs_remover/project/uncompiled-code/paket.references +3 -3
  77. data/spec/rake/funnel/support/specs_remover/project-specific paket.references/Sample.csproj.paket.references +3 -3
  78. data/spec/rake/funnel/support/specs_remover/project-specific paket.references/paket.references +3 -3
  79. data/spec/rake/funnel/support/specs_remover_spec.rb +31 -33
  80. data/spec/rake/funnel/support/template_engine_spec.rb +6 -3
  81. data/spec/rake/funnel/support/timing/report_spec.rb +19 -20
  82. data/spec/rake/funnel/support/trace_spec.rb +6 -6
  83. data/spec/rake/funnel/support/version_info_spec.rb +8 -6
  84. data/spec/rake/funnel/support/which_spec.rb +7 -7
  85. data/spec/rake/funnel/support/zipper_spec.rb +8 -8
  86. data/spec/rake/funnel/tasks/assembly_version_spec.rb +9 -9
  87. data/spec/rake/funnel/tasks/bin_path_spec.rb +23 -21
  88. data/spec/rake/funnel/tasks/copy_spec.rb +10 -10
  89. data/spec/rake/funnel/tasks/environments_spec.rb +48 -46
  90. data/spec/rake/funnel/tasks/msbuild_spec.rb +21 -17
  91. data/spec/rake/funnel/tasks/msdeploy_spec.rb +31 -31
  92. data/spec/rake/funnel/tasks/nunit_spec.rb +12 -10
  93. data/spec/rake/funnel/tasks/paket_spec.rb +25 -21
  94. data/spec/rake/funnel/tasks/quick_template_spec.rb +7 -7
  95. data/spec/rake/funnel/tasks/side_by_side_specs_spec.rb +12 -12
  96. data/spec/rake/funnel/tasks/timing_spec.rb +12 -12
  97. data/spec/rake/funnel/tasks/zip_spec.rb +16 -16
  98. data/spec/spec_helper.rb +5 -31
  99. metadata +7 -6
@@ -1,12 +1,14 @@
1
+ # rubocop:disable RSpec/FilePath
2
+
1
3
  include Rake
2
4
  include Rake::Funnel
3
5
  include Rake::Funnel::Support
4
6
  include Rake::Funnel::Support::MSBuild
5
7
 
6
8
  describe Rake::Funnel::Tasks::MSBuild do
7
- before {
9
+ before do
8
10
  Task.clear
9
- }
11
+ end
10
12
 
11
13
  describe 'defaults' do
12
14
  its(:name) { should == :compile }
@@ -15,9 +17,9 @@ describe Rake::Funnel::Tasks::MSBuild do
15
17
  its(:search_pattern) { should == %w(**/*.sln) }
16
18
 
17
19
  describe 'build tool' do
18
- before {
20
+ before do
19
21
  allow(BuildTool).to receive(:find).and_return('build tool')
20
- }
22
+ end
21
23
 
22
24
  it 'should use build tool finder' do
23
25
  expect(subject.msbuild).to eq('build tool')
@@ -28,19 +30,19 @@ describe Rake::Funnel::Tasks::MSBuild do
28
30
  describe 'execution' do
29
31
  let(:args) { {} }
30
32
 
31
- let(:mapper) { double(Mapper).as_null_object }
32
- let(:finder) { double(Finder).as_null_object }
33
+ let(:mapper) { instance_double(Mapper).as_null_object }
34
+ let(:finder) { instance_double(Finder).as_null_object }
33
35
 
34
- before {
36
+ before do
35
37
  allow(subject).to receive(:sh)
36
38
 
37
39
  allow(Mapper).to receive(:new).and_return(mapper)
38
40
  allow(Finder).to receive(:new).and_return(finder)
39
- }
41
+ end
40
42
 
41
- before {
43
+ before do
42
44
  Task[subject.name].invoke
43
- }
45
+ end
44
46
 
45
47
  it 'should use solution finder' do
46
48
  expect(finder).to have_received(:single)
@@ -60,30 +62,32 @@ describe Rake::Funnel::Tasks::MSBuild do
60
62
 
61
63
  describe 'overriding defaults' do
62
64
  context 'when msbuild executable is specified' do
63
- subject {
65
+ subject do
64
66
  described_class.new do |t|
65
67
  t.msbuild = 'custom build tool.exe'
66
68
  end
67
- }
69
+ end
68
70
 
69
71
  its(:msbuild) { should == 'custom build tool.exe' }
70
72
  end
71
73
 
72
74
  context 'when project or solution is specified' do
73
- before {
75
+ before do
74
76
  allow(Finder).to receive(:new).and_call_original
75
- }
77
+ end
76
78
 
77
- subject {
79
+ subject do
78
80
  described_class.new do |t|
79
81
  t.project_or_solution = 'project.sln'
80
82
  end
81
- }
83
+ end
82
84
 
83
85
  its(:project_or_solution) { should be_instance_of(Finder) }
84
86
 
85
87
  it 'should set project or solution' do
86
- expect(Finder).to have_received(:new).with('project.sln', subject, 'No projects or more than one project found.')
88
+ expect(Finder).to have_received(:new).with('project.sln',
89
+ subject,
90
+ 'No projects or more than one project found.')
87
91
  end
88
92
  end
89
93
  end
@@ -1,12 +1,14 @@
1
+ # rubocop:disable RSpec/FilePath
2
+
1
3
  include Rake
2
4
  include Rake::Funnel
3
5
  include Rake::Funnel::Support
4
6
  include Rake::Funnel::Support::MSDeploy
5
7
 
6
8
  describe Rake::Funnel::Tasks::MSDeploy do
7
- before {
9
+ before do
8
10
  Task.clear
9
- }
11
+ end
10
12
 
11
13
  describe 'defaults' do
12
14
  its(:name) { should == :msdeploy }
@@ -25,29 +27,29 @@ describe Rake::Funnel::Tasks::MSDeploy do
25
27
  let(:msdeploy) { 'msdeploy' }
26
28
  let(:args) { {} }
27
29
 
28
- subject {
30
+ subject do
29
31
  described_class.new do |t|
30
32
  t.msdeploy = msdeploy
31
33
  t.args = args
32
34
  end
33
- }
35
+ end
34
36
 
35
- before {
37
+ before do
36
38
  allow(subject).to receive(:shell)
37
39
 
38
40
  allow(RegistryPatch).to receive(:new).and_yield
39
- }
41
+ end
40
42
 
41
43
  describe 'argument mapping and invocation' do
42
- let(:mapper) { double(Mapper).as_null_object }
44
+ let(:mapper) { instance_double(Mapper).as_null_object }
43
45
 
44
- before {
46
+ before do
45
47
  allow(Mapper).to receive(:new).and_return(mapper)
46
- }
48
+ end
47
49
 
48
- before {
50
+ before do
49
51
  Task[subject.name].invoke
50
- }
52
+ end
51
53
 
52
54
  it 'should use MSDeploy mapper' do
53
55
  expect(Mapper).to have_received(:new).with(:MSDeploy)
@@ -59,20 +61,18 @@ describe Rake::Funnel::Tasks::MSDeploy do
59
61
 
60
62
  it 'should run with shell' do
61
63
  expect(subject).to have_received(:shell).with(/^msdeploy /,
62
- {
63
- log_file: 'msdeploy.log',
64
- error_lines: /^(error|[\w\.]*exception)/i
65
- })
64
+ log_file: 'msdeploy.log',
65
+ error_lines: /^(error|[\w\.]*exception)/i)
66
66
  end
67
67
  end
68
68
 
69
69
  describe 'arg examples' do
70
- before {
70
+ before do
71
71
  Task[subject.name].invoke
72
- }
72
+ end
73
73
 
74
74
  context 'skip actions' do
75
- let (:args) {
75
+ let(:args) do
76
76
  {
77
77
  verb: :sync,
78
78
  source: {
@@ -95,7 +95,7 @@ describe Rake::Funnel::Tasks::MSDeploy do
95
95
  use_checksum: nil,
96
96
  allow_untrusted: nil
97
97
  }
98
- }
98
+ end
99
99
 
100
100
  it 'should succeed' do
101
101
  args = %w(
@@ -107,14 +107,14 @@ describe Rake::Funnel::Tasks::MSDeploy do
107
107
  -skip:objectName=filePath,skipAction=Delete,absolutePath=App_Offline\.htm$
108
108
  -useChecksum
109
109
  -allowUntrusted
110
- )
110
+ )
111
111
 
112
112
  expect(subject).to have_received(:shell).with(args.join(' '), be_an_instance_of(Hash))
113
113
  end
114
114
  end
115
115
 
116
116
  context 'runCommand' do
117
- let(:args) {
117
+ let(:args) do
118
118
  {
119
119
  verb: :sync,
120
120
  source: {
@@ -128,7 +128,7 @@ describe Rake::Funnel::Tasks::MSDeploy do
128
128
  auto: true
129
129
  }
130
130
  }
131
- }
131
+ end
132
132
 
133
133
  it 'should succeed' do
134
134
  args = %w(
@@ -136,14 +136,14 @@ describe Rake::Funnel::Tasks::MSDeploy do
136
136
  -verb:sync
137
137
  -source:runCommand="cd ""C:\Program Files""",waitInterval=1
138
138
  -dest:computerName=remote.example.com,username=bob,password=secret,auto=true
139
- )
139
+ )
140
140
 
141
141
  expect(subject).to have_received(:shell).with(args.join(' '), be_an_instance_of(Hash))
142
142
  end
143
143
  end
144
144
 
145
145
  context 'preSync runCommand' do
146
- let(:args) {
146
+ let(:args) do
147
147
  {
148
148
  verb: :sync,
149
149
  pre_sync: {
@@ -159,7 +159,7 @@ describe Rake::Funnel::Tasks::MSDeploy do
159
159
  password: 'secret'
160
160
  }
161
161
  }
162
- }
162
+ end
163
163
 
164
164
  it 'should succeed' do
165
165
  args = %w(
@@ -168,7 +168,7 @@ describe Rake::Funnel::Tasks::MSDeploy do
168
168
  -preSync:runCommand="cd ""C:\Program Files""",dontUseCommandExe=true
169
169
  -source:contentPath=deploy
170
170
  -dest:computerName=remote.example.com,username=bob,password=secret
171
- )
171
+ )
172
172
 
173
173
  expect(subject).to have_received(:shell).with(args.join(' '), be_an_instance_of(Hash))
174
174
  end
@@ -176,9 +176,9 @@ describe Rake::Funnel::Tasks::MSDeploy do
176
176
  end
177
177
 
178
178
  describe "MSDeploy's idiocy" do
179
- before {
179
+ before do
180
180
  Task[subject.name].invoke
181
- }
181
+ end
182
182
 
183
183
  describe 'version registry value that is required to exist' do
184
184
  it 'should patch the registry' do
@@ -189,7 +189,7 @@ describe Rake::Funnel::Tasks::MSDeploy do
189
189
  describe 'command line parser that requires quotes inside but not outside parameters' do
190
190
  let(:msdeploy) { 'path to/msdeploy' }
191
191
 
192
- let(:args) {
192
+ let(:args) do
193
193
  {
194
194
  'simple key' => 'simple value',
195
195
  hash: {
@@ -199,7 +199,7 @@ describe Rake::Funnel::Tasks::MSDeploy do
199
199
  array: ['array value 1', 'array value 2'],
200
200
  'some flag' => nil
201
201
  }
202
- }
202
+ end
203
203
 
204
204
  it 'should quote the string' do
205
205
  args = %w(
@@ -209,7 +209,7 @@ describe Rake::Funnel::Tasks::MSDeploy do
209
209
  -array:"array value 1"
210
210
  -array:"array value 2"
211
211
  -"some flag"
212
- ).join(' ')
212
+ ).join(' ')
213
213
 
214
214
  expect(subject).to have_received(:shell).with(args, be_an_instance_of(Hash))
215
215
  end
@@ -1,12 +1,14 @@
1
+ # rubocop:disable RSpec/FilePath
2
+
1
3
  include Rake
2
4
  include Rake::Funnel
3
5
  include Rake::Funnel::Integration::TeamCity
4
6
  include Rake::Funnel::Support
5
7
 
6
8
  describe Rake::Funnel::Tasks::NUnit do
7
- before {
9
+ before do
8
10
  Task.clear
9
- }
11
+ end
10
12
 
11
13
  describe 'defaults' do
12
14
  its(:name) { should == :test }
@@ -18,10 +20,10 @@ describe Rake::Funnel::Tasks::NUnit do
18
20
  describe 'execution' do
19
21
  let(:args) { {} }
20
22
 
21
- let(:mapper) { double(Mapper).as_null_object }
22
- let(:finder) { double(Finder).as_null_object }
23
+ let(:mapper) { instance_double(Mapper).as_null_object }
24
+ let(:finder) { instance_double(Finder).as_null_object }
23
25
 
24
- before {
26
+ before do
25
27
  allow(subject).to receive(:sh)
26
28
 
27
29
  allow(Mapper).to receive(:new).and_return(mapper)
@@ -31,11 +33,11 @@ describe Rake::Funnel::Tasks::NUnit do
31
33
  allow(Mono).to receive(:invocation).and_wrap_original do |_original_method, *args, &_block|
32
34
  args.compact
33
35
  end
34
- }
36
+ end
35
37
 
36
- before {
38
+ before do
37
39
  Task[subject.name].invoke
38
- }
40
+ end
39
41
 
40
42
  it 'should use test assembly finder' do
41
43
  expect(finder).to have_received(:all)
@@ -62,11 +64,11 @@ describe Rake::Funnel::Tasks::NUnit do
62
64
  end
63
65
 
64
66
  context 'with custom NUnit executable' do
65
- subject {
67
+ subject do
66
68
  described_class.new do |t|
67
69
  t.nunit = 'custom nunit.exe'
68
70
  end
69
- }
71
+ end
70
72
 
71
73
  its(:nunit) { should == 'custom nunit.exe' }
72
74
  end
@@ -2,9 +2,9 @@ include Rake
2
2
  include Rake::Funnel::Support
3
3
 
4
4
  describe Rake::Funnel::Tasks::Paket do
5
- before {
5
+ before do
6
6
  Task.clear
7
- }
7
+ end
8
8
 
9
9
  describe 'defaults' do
10
10
  its(:name) { should == :paket }
@@ -15,31 +15,31 @@ describe Rake::Funnel::Tasks::Paket do
15
15
  end
16
16
 
17
17
  describe 'execution' do
18
- before {
18
+ before do
19
19
  allow(subject).to receive(:sh)
20
20
  allow(Mono).to receive(:invocation).and_wrap_original do |_original_method, *args, &_block|
21
21
  args.compact
22
22
  end
23
- }
23
+ end
24
24
 
25
25
  context 'overriding defaults' do
26
- subject {
26
+ subject do
27
27
  described_class.new do |t|
28
28
  t.bootstrapper = 'custom bootstrapper.exe'
29
29
  t.bootstrapper_args = %w(arg1 arg2)
30
30
  t.paket = 'custom paket.exe'
31
31
  t.paket_args = %w(arg1 arg2)
32
32
  end
33
- }
33
+ end
34
34
 
35
- before {
35
+ before do
36
36
  allow(File).to receive(:exist?).and_return(false)
37
37
  allow(subject).to receive(:sh)
38
- }
38
+ end
39
39
 
40
- before {
40
+ before do
41
41
  Task[subject.name].invoke
42
- }
42
+ end
43
43
 
44
44
  it 'should use custom bootstrapper' do
45
45
  expect(subject).to have_received(:sh).with(subject.bootstrapper, subject.bootstrapper_args)
@@ -51,9 +51,9 @@ describe Rake::Funnel::Tasks::Paket do
51
51
  end
52
52
 
53
53
  describe 'mono invocation' do
54
- before {
54
+ before do
55
55
  Task[subject.name].invoke
56
- }
56
+ end
57
57
 
58
58
  it 'should use mono invocation for bootstrapper' do
59
59
  expect(Mono).to have_received(:invocation).with(subject.bootstrapper, subject.bootstrapper_args)
@@ -65,15 +65,15 @@ describe Rake::Funnel::Tasks::Paket do
65
65
  end
66
66
 
67
67
  describe 'optional download' do
68
- before {
68
+ before do
69
69
  allow(File).to receive(:exist?).with(subject.paket).and_return(paket_exists)
70
70
  allow(subject).to receive(:sh).with(subject.bootstrapper)
71
- }
71
+ end
72
72
 
73
73
  context 'success' do
74
- before {
74
+ before do
75
75
  Task[subject.name].invoke
76
- }
76
+ end
77
77
 
78
78
  context 'paket.exe exists' do
79
79
  let(:paket_exists) { true }
@@ -105,9 +105,9 @@ describe Rake::Funnel::Tasks::Paket do
105
105
  let(:paket_exists) { true }
106
106
 
107
107
  context 'paket failed' do
108
- before {
108
+ before do
109
109
  allow(subject).to receive(:sh).with(subject.paket, anything).and_raise
110
- }
110
+ end
111
111
 
112
112
  it 'should fail' do
113
113
  expect { Task[subject.name].invoke }.to raise_error(RuntimeError)
@@ -119,12 +119,16 @@ describe Rake::Funnel::Tasks::Paket do
119
119
  let(:paket_exists) { false }
120
120
 
121
121
  context 'bootstrapper failed' do
122
- before {
122
+ before do
123
123
  allow(subject).to receive(:sh).with(subject.bootstrapper).and_raise
124
- }
124
+ end
125
125
 
126
126
  it 'should not run paket' do
127
- Task[subject.name].invoke rescue nil
127
+ begin
128
+ Task[subject.name].invoke
129
+ rescue
130
+ nil
131
+ end
128
132
 
129
133
  expect(subject).not_to have_received(:sh).with(subject.paket, subject.paket_args)
130
134
  end
@@ -4,9 +4,9 @@ include Rake
4
4
  include Rake::Funnel::Support
5
5
 
6
6
  describe Rake::Funnel::Tasks::QuickTemplate do
7
- before {
7
+ before do
8
8
  Task.clear
9
- }
9
+ end
10
10
 
11
11
  describe 'defaults' do
12
12
  its(:name) { should == :template }
@@ -17,23 +17,23 @@ describe Rake::Funnel::Tasks::QuickTemplate do
17
17
  describe 'execution' do
18
18
  let(:templates) { %w(1.template two/2.template) }
19
19
 
20
- let(:finder) { double(Finder).as_null_object }
20
+ let(:finder) { instance_double(Finder).as_null_object }
21
21
  let(:engine) { TemplateEngine }
22
22
 
23
- before {
23
+ before do
24
24
  allow(finder).to receive(:all_or_default).and_return(templates)
25
25
  allow(Finder).to receive(:new).and_return(finder)
26
26
  allow(engine).to receive(:render).and_return('file content')
27
27
  allow(Rake).to receive(:rake_output_message)
28
28
  allow(File).to receive(:read).and_return('template content')
29
29
  allow(File).to receive(:write)
30
- }
30
+ end
31
31
 
32
32
  subject! { described_class.new }
33
33
 
34
- before {
34
+ before do
35
35
  Task[subject.name].invoke
36
- }
36
+ end
37
37
 
38
38
  it 'should report created files' do
39
39
  templates.each do |template|
@@ -4,9 +4,9 @@ include Rake
4
4
  include Rake::Funnel::Support
5
5
 
6
6
  describe Rake::Funnel::Tasks::SideBySideSpecs do
7
- before {
7
+ before do
8
8
  Task.clear
9
- }
9
+ end
10
10
 
11
11
  describe 'defaults' do
12
12
  its(:name) { should == :compile }
@@ -18,7 +18,7 @@ describe Rake::Funnel::Tasks::SideBySideSpecs do
18
18
  end
19
19
 
20
20
  describe 'execution' do
21
- subject {
21
+ subject do
22
22
  described_class.new do |t|
23
23
  t.projects = %w(**/*.??proj)
24
24
  t.references = %w(Ref)
@@ -26,25 +26,25 @@ describe Rake::Funnel::Tasks::SideBySideSpecs do
26
26
  t.enabled = enabled
27
27
  t.packages = %w(Package)
28
28
  end
29
- }
29
+ end
30
30
 
31
- before {
31
+ before do
32
32
  allow(SpecsRemover).to receive(:remove)
33
- }
33
+ end
34
34
 
35
- before {
35
+ before do
36
36
  Task[subject.name].invoke
37
- }
37
+ end
38
38
 
39
39
  context 'enabled' do
40
40
  let(:enabled) { true }
41
41
 
42
42
  it 'should use remover' do
43
43
  expect(SpecsRemover).to have_received(:remove)
44
- .with(projects: subject.projects,
45
- references: subject.references,
46
- specs: subject.specs,
47
- packages: subject.packages)
44
+ .with(projects: subject.projects,
45
+ references: subject.references,
46
+ specs: subject.specs,
47
+ packages: subject.packages)
48
48
  end
49
49
  end
50
50
 
@@ -3,19 +3,19 @@ include Rake
3
3
  describe Rake::Funnel::Tasks::Timing do
4
4
  include DSL
5
5
 
6
- before {
6
+ before do
7
7
  Rake.application = nil
8
8
  Task.clear
9
9
 
10
10
  expect(define_tasks).to be
11
11
  expect(subject).to be
12
- }
12
+ end
13
13
 
14
14
  let(:define_tasks) { task :task }
15
15
 
16
- after {
16
+ after do
17
17
  subject.reset!
18
- }
18
+ end
19
19
 
20
20
  describe 'defaults' do
21
21
  its(:name) { should == :timing }
@@ -52,7 +52,7 @@ describe Rake::Funnel::Tasks::Timing do
52
52
  end
53
53
 
54
54
  describe 'execution' do
55
- before {
55
+ before do
56
56
  allow(Rake.application).to receive(:init)
57
57
  allow(Rake.application).to receive(:load_rakefile)
58
58
  Rake.application.top_level_tasks.unshift(:task)
@@ -64,14 +64,14 @@ describe Rake::Funnel::Tasks::Timing do
64
64
  allow($stderr).to receive(:print)
65
65
 
66
66
  Rake.application.run
67
- }
67
+ end
68
68
 
69
69
  context 'with task defined' do
70
- let(:define_tasks) {
70
+ let(:define_tasks) do
71
71
  task :task do
72
72
  puts 'hello'
73
73
  end
74
- }
74
+ end
75
75
 
76
76
  it 'should execute tasks' do
77
77
  expect($stdout).to have_received(:puts).with('hello')
@@ -92,10 +92,10 @@ describe Rake::Funnel::Tasks::Timing do
92
92
  end
93
93
 
94
94
  context 'with unreachable task defined' do
95
- let(:define_tasks) {
95
+ let(:define_tasks) do
96
96
  task :task
97
97
  task :not_executed
98
- }
98
+ end
99
99
 
100
100
  it 'should not record timing information for unexecuted tasks' do
101
101
  expect(subject.stats.map { |s| s[:task].name }).not_to include('not_executed')
@@ -114,11 +114,11 @@ describe Rake::Funnel::Tasks::Timing do
114
114
  end
115
115
 
116
116
  context 'when rake failed' do
117
- let(:define_tasks) {
117
+ let(:define_tasks) do
118
118
  task :task do
119
119
  raise
120
120
  end
121
- }
121
+ end
122
122
 
123
123
  it 'should print the report' do
124
124
  expect($stdout).to have_received(:puts).with(/Build time report/)