test_launcher 2.15.0 → 2.18.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +24 -27
- data/lib/test_launcher/cli.rb +45 -10
- data/lib/test_launcher/cli/input_parser.rb +8 -7
- data/lib/test_launcher/frameworks/ex_unit.rb +1 -1
- data/lib/test_launcher/frameworks/minitest.rb +1 -1
- data/lib/test_launcher/frameworks/mochajs.rb +1 -2
- data/lib/test_launcher/frameworks/rspec.rb +1 -1
- data/lib/test_launcher/queries.rb +92 -42
- data/lib/test_launcher/shell/runner.rb +1 -1
- data/lib/test_launcher/version.rb +1 -1
- data/test/test_launcher/queries/example_name_query_test.rb +13 -13
- data/test/test_launcher/queries/full_regex_query_test.rb +4 -4
- data/test/test_launcher/queries/line_number_query_test.rb +2 -2
- data/test/test_launcher/queries/multi_path_query_test.rb +2 -2
- data/test/test_launcher/queries/path_query_test.rb +9 -9
- data/test_launcher.gemspec +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 44d9c4826741dd27173463fbac8e3b2e06c380d6
|
4
|
+
data.tar.gz: 3b2eb4889d798e790c8ebbb76c34ef1af19f1e5e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 22bc5978c05f28e01edec088c61ea930242a1a05fe3067c215dab917385699fa017d6c5e3556d29d56164861cf8eca8ae463062332d1a8a65065671df1331640
|
7
|
+
data.tar.gz: cbc3e9296109f94a4052ce41810ce031c5b32643f0d0aa2e6206f64b685e0890b32bc72d4fa700d96a89aa067429c58ca8624f872f25e5c068e138598b4c8c0e
|
data/README.md
CHANGED
@@ -362,33 +362,30 @@ If you don't want to use spring to run your tests, but test_launcher tries to us
|
|
362
362
|
|
363
363
|
# Visual Studio Code Support
|
364
364
|
|
365
|
-
Install the [
|
366
|
-
|
367
|
-
```
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
"match": ".*"
|
390
|
-
}
|
391
|
-
},
|
365
|
+
Install the [Terminal Command Keys](https://marketplace.visualstudio.com/items?itemName=petekinnecom.terminal-command-keys) extension (you can search for `petekinnecom.terminal-command-keys` in vscode's extension search box). This allows us to assign keybindings to specific terminal commands. Then we can add TestLauncher keybindings to our `keybindings.json`. Here is an example configuration:
|
366
|
+
|
367
|
+
```
|
368
|
+
{
|
369
|
+
"key": "shift+cmd+r",
|
370
|
+
"command": "terminalCommandKeys.run",
|
371
|
+
"args": {
|
372
|
+
"cmd": "test_launcher ${file}:${line}",
|
373
|
+
}
|
374
|
+
},
|
375
|
+
{
|
376
|
+
"key": "alt+cmd+r",
|
377
|
+
"command": "terminalCommandKeys.run",
|
378
|
+
"args": {
|
379
|
+
"cmd": "test_launcher ${file}",
|
380
|
+
}
|
381
|
+
},
|
382
|
+
{
|
383
|
+
"key": "cmd+r",
|
384
|
+
"command": "terminalCommandKeys.run",
|
385
|
+
"args": {
|
386
|
+
"cmd": "test_launcher --rerun",
|
387
|
+
}
|
388
|
+
}
|
392
389
|
```
|
393
390
|
|
394
391
|
# Atom Support
|
data/lib/test_launcher/cli.rb
CHANGED
@@ -7,18 +7,51 @@ require "test_launcher/cli/request"
|
|
7
7
|
module TestLauncher
|
8
8
|
module CLI
|
9
9
|
class MultiFrameworkQuery < Struct.new(:cli_options)
|
10
|
+
@@mutex = Mutex.new
|
11
|
+
|
10
12
|
def command
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
13
|
+
# do them all at the same time!
|
14
|
+
@count = cli_options.frameworks.count
|
15
|
+
@finished = 0
|
16
|
+
@value = nil
|
17
|
+
@now = Time.now.to_f
|
18
|
+
@generic_default = nil
|
19
|
+
|
20
|
+
cli_options.frameworks.each do |framework|
|
21
|
+
Thread.new do
|
22
|
+
finder = Queries::CommandFinder.new(request_for(framework))
|
23
|
+
ex = nil
|
24
|
+
|
25
|
+
begin
|
26
|
+
val = finder.generic_search
|
27
|
+
rescue => e
|
28
|
+
ex = e
|
29
|
+
end
|
30
|
+
|
31
|
+
@@mutex.synchronize do
|
32
|
+
@finished += 1
|
33
|
+
|
34
|
+
if framework == Frameworks::Generic
|
35
|
+
@generic_default = val
|
36
|
+
else
|
37
|
+
if ex && !@exception
|
38
|
+
@exception = ex
|
39
|
+
elsif val && !@value
|
40
|
+
@value = val
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
while (@finished < @count && !@value && !@exception) do
|
48
|
+
sleep(0.05)
|
15
49
|
end
|
16
|
-
command
|
17
|
-
end
|
18
50
|
|
19
|
-
|
20
|
-
|
21
|
-
|
51
|
+
if @exception
|
52
|
+
raise @exception
|
53
|
+
else
|
54
|
+
@value || @generic_default
|
22
55
|
end
|
23
56
|
end
|
24
57
|
|
@@ -47,7 +80,9 @@ module TestLauncher
|
|
47
80
|
|
48
81
|
if options.rerun
|
49
82
|
shell.reexec
|
50
|
-
elsif
|
83
|
+
elsif result = MultiFrameworkQuery.new(options).command
|
84
|
+
result.fetch(:notifies, []).each {|n| shell.notify(n)}
|
85
|
+
command = result.fetch(:command)
|
51
86
|
command = yield(command) if block_given?
|
52
87
|
if command
|
53
88
|
shell.exec(command)
|
@@ -61,12 +61,13 @@ VERSION: #{TestLauncher::VERSION}
|
|
61
61
|
elsif @options[:framework] == "generic"
|
62
62
|
[Frameworks::Generic]
|
63
63
|
else
|
64
|
-
[
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
64
|
+
[
|
65
|
+
Frameworks::Minitest,
|
66
|
+
Frameworks::RSpec,
|
67
|
+
Frameworks::ExUnit,
|
68
|
+
Frameworks::Mochajs,
|
69
|
+
Frameworks::Generic,
|
70
|
+
].select {|f| f.active?}
|
70
71
|
end
|
71
72
|
|
72
73
|
Options.new(
|
@@ -110,7 +111,7 @@ VERSION: #{TestLauncher::VERSION}
|
|
110
111
|
options[:framework] = framework
|
111
112
|
end
|
112
113
|
|
113
|
-
opts.on("-n", "--name name", "
|
114
|
+
opts.on("-n", "--name name", "Private option: DO NOT USE") do |name|
|
114
115
|
options[:name] = name
|
115
116
|
end
|
116
117
|
|
@@ -6,8 +6,7 @@ module TestLauncher
|
|
6
6
|
module Mochajs
|
7
7
|
|
8
8
|
def self.active?
|
9
|
-
|
10
|
-
!output.chomp.strip.empty?.tap {|r| puts "mochajs: #{r}"}
|
9
|
+
`git ls-files '*pec.js'`.split("\n").any?
|
11
10
|
end
|
12
11
|
|
13
12
|
def self.test_case(*a)
|
@@ -117,12 +117,18 @@ module TestLauncher
|
|
117
117
|
if test_cases.empty?
|
118
118
|
shell.warn("Could not identify file: #{request.search_string}")
|
119
119
|
elsif test_cases.size == 1
|
120
|
-
|
121
|
-
|
120
|
+
{
|
121
|
+
notifies: ["Found 1 example in 1 file."],
|
122
|
+
command: runner.single_example(test_cases.first)
|
123
|
+
}
|
122
124
|
else
|
123
|
-
|
124
|
-
|
125
|
-
|
125
|
+
{
|
126
|
+
notifies: [
|
127
|
+
"Found #{pluralize(test_cases.size, "example")} in #{pluralize(file_count, "file")}.",
|
128
|
+
"Running most recently edited. Run with '--all' to run all the tests."
|
129
|
+
],
|
130
|
+
command: runner.single_example(most_recently_edited_test_case)
|
131
|
+
}
|
126
132
|
end
|
127
133
|
end
|
128
134
|
|
@@ -144,7 +150,9 @@ module TestLauncher
|
|
144
150
|
class RerunQuery < BaseQuery
|
145
151
|
def command
|
146
152
|
if File.exists?("/tmp/test_launcher__last_run")
|
147
|
-
|
153
|
+
{
|
154
|
+
command: File.read("/tmp/test_launcher__last_run").chomp
|
155
|
+
}
|
148
156
|
end
|
149
157
|
end
|
150
158
|
end
|
@@ -154,8 +162,10 @@ module TestLauncher
|
|
154
162
|
return unless request.search_string.include?(" ")
|
155
163
|
return if test_cases.empty?
|
156
164
|
|
157
|
-
|
158
|
-
|
165
|
+
{
|
166
|
+
notifies: ["Found #{pluralize(file_count, "file")}."],
|
167
|
+
command: runner.multiple_files(test_cases)
|
168
|
+
}
|
159
169
|
end
|
160
170
|
|
161
171
|
def test_cases
|
@@ -194,15 +204,24 @@ module TestLauncher
|
|
194
204
|
return if test_cases.empty?
|
195
205
|
|
196
206
|
if one_file?
|
197
|
-
|
198
|
-
|
207
|
+
{
|
208
|
+
notifies: ["Found #{pluralize(file_count, "file")}."],
|
209
|
+
command: runner.single_file(test_cases.first)
|
210
|
+
}
|
199
211
|
elsif request.run_all?
|
200
|
-
|
201
|
-
|
212
|
+
{
|
213
|
+
notifies: ["Found #{pluralize(file_count, "file")}."],
|
214
|
+
command: runner.multiple_files(test_cases)
|
215
|
+
}
|
202
216
|
else
|
203
|
-
|
204
|
-
|
205
|
-
|
217
|
+
{
|
218
|
+
notifies: [
|
219
|
+
"Found #{pluralize(file_count, "file")}.",
|
220
|
+
"Running most recently edited. Run with '--all' to run all the tests.",
|
221
|
+
|
222
|
+
],
|
223
|
+
command: runner.single_file(most_recently_edited_test_case)
|
224
|
+
}
|
206
225
|
end
|
207
226
|
end
|
208
227
|
|
@@ -222,18 +241,28 @@ module TestLauncher
|
|
222
241
|
return if test_cases.empty?
|
223
242
|
|
224
243
|
if one_example?
|
225
|
-
|
226
|
-
|
244
|
+
{
|
245
|
+
notifies: ["Found 1 example in 1 file."],
|
246
|
+
command: runner.single_example(test_cases.first)
|
247
|
+
}
|
227
248
|
elsif one_file?
|
228
|
-
|
229
|
-
|
249
|
+
{
|
250
|
+
notifies: ["Found #{test_cases.size} examples in 1 file."],
|
251
|
+
command: runner.multiple_examples_same_file(test_cases) # it will regex with the query
|
252
|
+
}
|
230
253
|
elsif request.run_all?
|
231
|
-
|
232
|
-
|
254
|
+
{
|
255
|
+
notifies: ["Found #{pluralize(test_cases.size, "example")} in #{pluralize(file_count, "file")}."],
|
256
|
+
command: runner.multiple_examples(test_cases)
|
257
|
+
}
|
233
258
|
else
|
234
|
-
|
235
|
-
|
236
|
-
|
259
|
+
{
|
260
|
+
notifies: [
|
261
|
+
"Found #{pluralize(test_cases.size, "example")} in #{pluralize(file_count, "file")}.",
|
262
|
+
"Running most recently edited. Run with '--all' to run all the tests.",
|
263
|
+
],
|
264
|
+
command: runner.single_example(most_recently_edited_test_case) # let it regex the query
|
265
|
+
}
|
237
266
|
end
|
238
267
|
end
|
239
268
|
|
@@ -264,14 +293,20 @@ module TestLauncher
|
|
264
293
|
return if test_cases.empty?
|
265
294
|
|
266
295
|
if one_example?
|
267
|
-
|
268
|
-
|
296
|
+
{
|
297
|
+
notifies: ["Found 1 example in 1 file."],
|
298
|
+
command: runner.single_example(test_cases.first)
|
299
|
+
}
|
269
300
|
elsif one_file?
|
270
|
-
|
271
|
-
|
301
|
+
{
|
302
|
+
notifies: ["Found #{test_cases.size} examples in 1 file."],
|
303
|
+
command: runner.multiple_examples_same_file(test_cases) # it will regex with the query
|
304
|
+
}
|
272
305
|
else
|
273
|
-
|
274
|
-
|
306
|
+
{
|
307
|
+
notifies: ["Found #{pluralize(test_cases.size, "example")} in #{pluralize(file_count, "file")}."],
|
308
|
+
command: runner.multiple_examples(test_cases)
|
309
|
+
}
|
275
310
|
end
|
276
311
|
end
|
277
312
|
|
@@ -306,15 +341,23 @@ module TestLauncher
|
|
306
341
|
return if test_cases.empty?
|
307
342
|
|
308
343
|
if one_file?
|
309
|
-
|
310
|
-
|
344
|
+
{
|
345
|
+
notifies: ["Found #{pluralize(file_count, "file")}."],
|
346
|
+
command: runner.single_file(test_cases.first)
|
347
|
+
}
|
311
348
|
elsif request.run_all?
|
312
|
-
|
313
|
-
|
349
|
+
{
|
350
|
+
notifies: ["Found #{pluralize(file_count, "file")}."],
|
351
|
+
command: runner.multiple_files(test_cases)
|
352
|
+
}
|
314
353
|
else
|
315
|
-
|
316
|
-
|
317
|
-
|
354
|
+
{
|
355
|
+
notifies: [
|
356
|
+
"Found #{pluralize(file_count, "file")}.",
|
357
|
+
"Running most recently edited. Run with '--all' to run all the tests.",
|
358
|
+
],
|
359
|
+
command: runner.single_file(most_recently_edited_test_case)
|
360
|
+
}
|
318
361
|
end
|
319
362
|
end
|
320
363
|
|
@@ -343,6 +386,7 @@ module TestLauncher
|
|
343
386
|
end
|
344
387
|
|
345
388
|
def files_found_by_joining_terms
|
389
|
+
return [] unless request.search_string.include?(" ")
|
346
390
|
joined_query = request.search_string.squeeze(" ").gsub(" ", "|")
|
347
391
|
@files_found_by_joining_terms ||= searcher.grep(joined_query)
|
348
392
|
end
|
@@ -356,12 +400,18 @@ module TestLauncher
|
|
356
400
|
return unless test_cases.any?
|
357
401
|
|
358
402
|
if one_file?
|
359
|
-
|
360
|
-
|
403
|
+
{
|
404
|
+
notifies: ["Found #{pluralize(file_count, "file")}."],
|
405
|
+
command: runner.by_line_number(test_cases.first)
|
406
|
+
}
|
361
407
|
else
|
362
|
-
|
363
|
-
|
364
|
-
|
408
|
+
{
|
409
|
+
notifies: [
|
410
|
+
"Found #{pluralize(file_count, "file")}.",
|
411
|
+
"Cannot run all tests with --all because test frameworks don't accept multiple file/lines combos."
|
412
|
+
],
|
413
|
+
command: runner.by_line_number(most_recently_edited_test_case)
|
414
|
+
}
|
365
415
|
end
|
366
416
|
end
|
367
417
|
|
@@ -106,7 +106,7 @@ module TestLauncher
|
|
106
106
|
|
107
107
|
command = ExampleNameQuery.new(request, default_command_finder).command
|
108
108
|
|
109
|
-
assert_equal "single_example file_1_test.rb one_example", command
|
109
|
+
assert_equal "single_example file_1_test.rb one_example", command[:command]
|
110
110
|
end
|
111
111
|
|
112
112
|
def test_command__one_example_found__notifies
|
@@ -120,9 +120,9 @@ module TestLauncher
|
|
120
120
|
command = ExampleNameQuery.new(request, default_command_finder).command
|
121
121
|
|
122
122
|
messages = [
|
123
|
-
|
123
|
+
"Found 1 example in 1 file.",
|
124
124
|
]
|
125
|
-
assert_equal messages,
|
125
|
+
assert_equal messages, command[:notifies]
|
126
126
|
end
|
127
127
|
|
128
128
|
def test_command__multiple_examples__one_file
|
@@ -135,7 +135,7 @@ module TestLauncher
|
|
135
135
|
|
136
136
|
command = ExampleNameQuery.new(request, default_command_finder).command
|
137
137
|
|
138
|
-
assert_equal "multiple_examples_same_file file_1_test.rb same_file", command
|
138
|
+
assert_equal "multiple_examples_same_file file_1_test.rb same_file", command[:command]
|
139
139
|
end
|
140
140
|
|
141
141
|
def test_command__multiple_examples__one_file__notifies
|
@@ -149,9 +149,9 @@ module TestLauncher
|
|
149
149
|
command = ExampleNameQuery.new(request, default_command_finder).command
|
150
150
|
|
151
151
|
messages = [
|
152
|
-
|
152
|
+
"Found 2 examples in 1 file.",
|
153
153
|
]
|
154
|
-
assert_equal messages,
|
154
|
+
assert_equal messages, command[:notifies]
|
155
155
|
end
|
156
156
|
|
157
157
|
def test_command__multiple_examples__multiple_files__no_all
|
@@ -165,7 +165,7 @@ module TestLauncher
|
|
165
165
|
|
166
166
|
command = ExampleNameQuery.new(request, default_command_finder).command
|
167
167
|
|
168
|
-
assert_equal "single_example file_2_test.rb different_files", command
|
168
|
+
assert_equal "single_example file_2_test.rb different_files", command[:command]
|
169
169
|
end
|
170
170
|
|
171
171
|
def test_command__multiple_examples__multiple_files__no_all__notifies
|
@@ -180,10 +180,10 @@ module TestLauncher
|
|
180
180
|
command = ExampleNameQuery.new(request, default_command_finder).command
|
181
181
|
|
182
182
|
messages = [
|
183
|
-
|
184
|
-
|
183
|
+
"Found 2 examples in 2 files.",
|
184
|
+
"Running most recently edited. Run with '--all' to run all the tests.",
|
185
185
|
]
|
186
|
-
assert_equal messages,
|
186
|
+
assert_equal messages, command[:notifies]
|
187
187
|
end
|
188
188
|
|
189
189
|
def test_command__multiple_examples__multiple_files__all
|
@@ -197,7 +197,7 @@ module TestLauncher
|
|
197
197
|
|
198
198
|
command = ExampleNameQuery.new(request, default_command_finder).command
|
199
199
|
|
200
|
-
assert_equal "multiple_examples file_1_test.rb file_2_test.rb", command
|
200
|
+
assert_equal "multiple_examples file_1_test.rb file_2_test.rb", command[:command]
|
201
201
|
end
|
202
202
|
|
203
203
|
def test_command__multiple_examples__multiple_files__all__notifies
|
@@ -212,9 +212,9 @@ module TestLauncher
|
|
212
212
|
command = ExampleNameQuery.new(request, default_command_finder).command
|
213
213
|
|
214
214
|
messages = [
|
215
|
-
|
215
|
+
"Found 2 examples in 2 files.",
|
216
216
|
]
|
217
|
-
assert_equal messages,
|
217
|
+
assert_equal messages, command[:notifies]
|
218
218
|
end
|
219
219
|
end
|
220
220
|
end
|
@@ -105,7 +105,7 @@ module TestLauncher
|
|
105
105
|
|
106
106
|
command = FullRegexQuery.new(request, default_command_finder).command
|
107
107
|
|
108
|
-
assert_equal "single_file single_test.rb", command
|
108
|
+
assert_equal "single_file single_test.rb", command[:command]
|
109
109
|
end
|
110
110
|
|
111
111
|
def test_command__multiple_matches_same_file
|
@@ -118,7 +118,7 @@ module TestLauncher
|
|
118
118
|
|
119
119
|
command = FullRegexQuery.new(request, default_command_finder).command
|
120
120
|
|
121
|
-
assert_equal "single_file multiple_matches_1_test.rb", command
|
121
|
+
assert_equal "single_file multiple_matches_1_test.rb", command[:command]
|
122
122
|
end
|
123
123
|
|
124
124
|
def test_command__multiple_matches_different_files__no_all
|
@@ -132,7 +132,7 @@ module TestLauncher
|
|
132
132
|
|
133
133
|
command = FullRegexQuery.new(request, default_command_finder).command
|
134
134
|
|
135
|
-
assert_equal "single_file multiple_matches_2_test.rb", command
|
135
|
+
assert_equal "single_file multiple_matches_2_test.rb", command[:command]
|
136
136
|
end
|
137
137
|
|
138
138
|
def test_command__multiple_matches_different_files__all
|
@@ -146,7 +146,7 @@ module TestLauncher
|
|
146
146
|
|
147
147
|
command = FullRegexQuery.new(request, default_command_finder).command
|
148
148
|
|
149
|
-
assert_equal "multiple_files multiple_matches_1_test.rb multiple_matches_2_test.rb", command
|
149
|
+
assert_equal "multiple_files multiple_matches_1_test.rb multiple_matches_2_test.rb", command[:command]
|
150
150
|
end
|
151
151
|
end
|
152
152
|
end
|
@@ -84,7 +84,7 @@ module TestLauncher
|
|
84
84
|
|
85
85
|
assert_equal [[whole_file_test_case]], default_runner.recall(:by_line_number)
|
86
86
|
|
87
|
-
assert_equal "by_line_number_return", command
|
87
|
+
assert_equal "by_line_number_return", command[:command]
|
88
88
|
end
|
89
89
|
|
90
90
|
|
@@ -100,7 +100,7 @@ module TestLauncher
|
|
100
100
|
|
101
101
|
assert_equal [[example_name_test_case]], default_runner.recall(:by_line_number)
|
102
102
|
|
103
|
-
assert_equal "by_line_number_return", command
|
103
|
+
assert_equal "by_line_number_return", command[:command]
|
104
104
|
end
|
105
105
|
end
|
106
106
|
end
|
@@ -107,7 +107,7 @@ module TestLauncher
|
|
107
107
|
command = MultiPathQuery.new(request, default_command_finder).command
|
108
108
|
|
109
109
|
assert_equal [[[file_1_test_case, file_2_test_case]]], default_runner.recall(:multiple_files)
|
110
|
-
assert_equal "multiple_files_return", command
|
110
|
+
assert_equal "multiple_files_return", command[:command]
|
111
111
|
end
|
112
112
|
|
113
113
|
def test_command__finds_files_for_2_of_2_terms__extra_files_found
|
@@ -119,7 +119,7 @@ module TestLauncher
|
|
119
119
|
)
|
120
120
|
command = MultiPathQuery.new(request, default_command_finder).command
|
121
121
|
assert_equal [[[file_1_test_case, file_3_test_case, file_4_test_case]]], default_runner.recall(:multiple_files)
|
122
|
-
assert_equal "multiple_files_return", command
|
122
|
+
assert_equal "multiple_files_return", command[:command]
|
123
123
|
end
|
124
124
|
end
|
125
125
|
end
|
@@ -92,7 +92,7 @@ module TestLauncher
|
|
92
92
|
command = PathQuery.new(request, default_command_finder).command
|
93
93
|
|
94
94
|
assert_equal [[normal_test_case]], default_runner.recall(:single_file)
|
95
|
-
assert_equal "single_file_return", command
|
95
|
+
assert_equal "single_file_return", command[:command]
|
96
96
|
end
|
97
97
|
|
98
98
|
def test_command__one_file_found__has_correct_test_case
|
@@ -120,7 +120,7 @@ module TestLauncher
|
|
120
120
|
|
121
121
|
command = PathQuery.new(request, default_command_finder).command
|
122
122
|
|
123
|
-
assert_equal [
|
123
|
+
assert_equal ["Found 1 file."], command[:notifies]
|
124
124
|
end
|
125
125
|
|
126
126
|
def test_command__multiple_files_found__no_all__runs_single_file
|
@@ -135,7 +135,7 @@ module TestLauncher
|
|
135
135
|
command = PathQuery.new(request, default_command_finder).command
|
136
136
|
|
137
137
|
assert_equal [[new_test_case]], default_runner.recall(:single_file)
|
138
|
-
assert_equal "single_file_return", command
|
138
|
+
assert_equal "single_file_return", command[:command]
|
139
139
|
end
|
140
140
|
|
141
141
|
def test_command__multiple_files_found__no_all__notifies
|
@@ -150,10 +150,10 @@ module TestLauncher
|
|
150
150
|
command = PathQuery.new(request, default_command_finder).command
|
151
151
|
|
152
152
|
messages = [
|
153
|
-
|
154
|
-
|
153
|
+
"Found 3 files.",
|
154
|
+
"Running most recently edited. Run with '--all' to run all the tests."
|
155
155
|
]
|
156
|
-
assert_equal messages,
|
156
|
+
assert_equal messages, command[:notifies]
|
157
157
|
end
|
158
158
|
|
159
159
|
def test_command__multiple_files_found__all__runs_single_file
|
@@ -168,7 +168,7 @@ module TestLauncher
|
|
168
168
|
command = PathQuery.new(request, default_command_finder).command
|
169
169
|
|
170
170
|
assert_equal [[[old_test_case, older_test_case, new_test_case]]], default_runner.recall(:multiple_files)
|
171
|
-
assert_equal "multiple_files_return", command
|
171
|
+
assert_equal "multiple_files_return", command[:command]
|
172
172
|
end
|
173
173
|
|
174
174
|
def test_command__multiple_files_found__all__notifies
|
@@ -183,9 +183,9 @@ module TestLauncher
|
|
183
183
|
command = PathQuery.new(request, default_command_finder).command
|
184
184
|
|
185
185
|
messages = [
|
186
|
-
|
186
|
+
"Found 3 files."
|
187
187
|
]
|
188
|
-
assert_equal messages,
|
188
|
+
assert_equal messages, command[:notifies]
|
189
189
|
end
|
190
190
|
end
|
191
191
|
end
|
data/test_launcher.gemspec
CHANGED
@@ -18,6 +18,6 @@ Gem::Specification.new do |spec|
|
|
18
18
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
19
|
spec.require_paths = ["lib"]
|
20
20
|
|
21
|
-
spec.
|
21
|
+
spec.add_development_dependency "bundler", "~> 1.7"
|
22
22
|
spec.add_development_dependency "rake", "~> 10.0"
|
23
23
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: test_launcher
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.18.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pete Kinnecom
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-08-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -17,7 +17,7 @@ dependencies:
|
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '1.7'
|
20
|
-
type: :
|
20
|
+
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|