test_launcher 2.9.0 → 2.10.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6b037d56bb5d66021c7e01731332262d1f0b85dd
4
- data.tar.gz: f88df5c4fe6af76f57d60567207426049a56182a
3
+ metadata.gz: da8cb4f051860842d29afa313d9abecb88b8a92f
4
+ data.tar.gz: 92425cda5894cc6ac4c0a5819f6d8e62d2aad695
5
5
  SHA512:
6
- metadata.gz: d661ffc05735357b8b74ea8f982d39d1d91f4f6d383330645e98f9f51967306e62cc192256ac9839bc83080e05ead4a8266e80729fe89374e0aa5a253d4a2fa2
7
- data.tar.gz: d6490649619043ec9ce41da84c88e3d197b24f16814d103f888f69f6ee9c176350a0b1e18c73ef68744db78016187db3c182b6ffa6097ee0f75012ba8c9fc910
6
+ metadata.gz: d2d49ee5824b74a1934527854e953a46362db53fc6b15d0c1366a27886f74d3a167a1f02981e4d9a503ff08b99aa7b61d33c90a6c8378c323f5ef4b105123f40
7
+ data.tar.gz: b148dfc41efbe867659d62e5dc9430190fb22b3cf69c8060cf066c6242b7306055ddbba988d84780e222cdf053d6af79ec7a75947b44f817b8377675f5615c56
@@ -29,6 +29,7 @@ module TestLauncher
29
29
  rerun: cli_options.rerun,
30
30
  run_all: cli_options.run_all,
31
31
  disable_spring: cli_options.disable_spring,
32
+ force_spring: cli_options.force_spring,
32
33
  example_name: cli_options.example_name,
33
34
  shell: cli_options.shell,
34
35
  searcher: cli_options.searcher,
@@ -68,6 +68,7 @@ VERSION: #{TestLauncher::VERSION}
68
68
  run_all: !!@options[:run_all],
69
69
  rerun: !!@options[:rerun],
70
70
  disable_spring: @options[:disable_spring] || !!@env["DISABLE_SPRING"],
71
+ force_spring: @options[:force_spring],
71
72
  example_name: @options[:name],
72
73
  frameworks: frameworks,
73
74
  shell: shell,
@@ -116,8 +117,22 @@ VERSION: #{TestLauncher::VERSION}
116
117
  end
117
118
 
118
119
  opts.on("--disable-spring", "Disable spring. You can also set the env var: DISABLE_SPRING=1") do
120
+ if options[:force_spring]
121
+ puts "You have specified both --spring and --disable-spring. Please specify only one."
122
+ exit(1)
123
+ end
124
+
119
125
  options[:disable_spring] = true
120
126
  end
127
+
128
+ opts.on("--spring", "Force spring commands to be used (useful when test_launcher is unable to detect that spring is used)") do
129
+ if options[:disable_spring]
130
+ puts "You have specified both --spring and --disable-spring. Please specify only one."
131
+ exit(1)
132
+ end
133
+
134
+ options[:force_spring] = true
135
+ end
121
136
  end
122
137
  end
123
138
  end
@@ -6,6 +6,7 @@ module TestLauncher
6
6
  :rerun,
7
7
  :run_all,
8
8
  :disable_spring,
9
+ :force_spring,
9
10
  :example_name,
10
11
  :shell,
11
12
  :searcher
@@ -7,6 +7,7 @@ module TestLauncher
7
7
  rerun: false,
8
8
  run_all: false,
9
9
  disable_spring: false,
10
+ force_spring: false,
10
11
  example_name: nil,
11
12
  shell:,
12
13
  searcher:
@@ -16,6 +17,7 @@ module TestLauncher
16
17
  @rerun = rerun
17
18
  @run_all = run_all
18
19
  @disable_spring = disable_spring
20
+ @force_spring = force_spring
19
21
  @example_name = example_name
20
22
  @shell = shell
21
23
  @searcher = searcher
@@ -37,6 +39,10 @@ module TestLauncher
37
39
  @disable_spring
38
40
  end
39
41
 
42
+ def force_spring?
43
+ @force_spring
44
+ end
45
+
40
46
  def example_name
41
47
  @example_name
42
48
  end
@@ -147,6 +147,7 @@ Open an issue on https://github.com/petekinnecom/test_launcher if this is someth
147
147
 
148
148
  def spring_enabled?
149
149
  return false if request.disable_spring?
150
+ return true if request.force_spring?
150
151
 
151
152
  [
152
153
  "bin/spring",
@@ -1,3 +1,3 @@
1
1
  module TestLauncher
2
- VERSION = "2.9.0"
2
+ VERSION = "2.10.0"
3
3
  end
@@ -279,6 +279,20 @@ module TestLauncher
279
279
  assert_equal "cd /src && bundle exec ruby -I test -e 'ARGV.each {|f| require(f)}' /src/test/class_1_test.rb", shell_mock.recall_exec
280
280
  end
281
281
 
282
+ def test_uses_spring__if_forced
283
+ searcher = MemorySearcher.new do |searcher|
284
+ searcher.mock_file do |f|
285
+ f.path "/src/test/class_1_test.rb"
286
+ f.contents <<-RB
287
+ def test_name
288
+ RB
289
+ end
290
+ end
291
+
292
+ launch("class_1_test.rb --spring", env: {}, searcher: searcher)
293
+ assert_equal "cd /src && bundle exec spring testunit /src/test/class_1_test.rb", shell_mock.recall_exec
294
+ end
295
+
282
296
  def test__by_regex__one_match
283
297
  searcher = MemorySearcher.new do |searcher|
284
298
  searcher.mock_file do |f|
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.9.0
4
+ version: 2.10.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: 2017-09-13 00:00:00.000000000 Z
11
+ date: 2017-12-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler