test_launcher 2.12.0 → 2.13.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: 9b3ce6982ef89dc1b00a8c17bbf8f0219d616143
4
- data.tar.gz: eec643d857980c326cc97131d6f1254efec845a7
3
+ metadata.gz: '03096ccb24f5885cb336f3e8347e81b9c55ef8d9'
4
+ data.tar.gz: 0eaf428d325b1add82cdc3b178c95bf62373c173
5
5
  SHA512:
6
- metadata.gz: 5cf6705fc601e32a06bef58a25f7cb075f1f8545e1b800889fe4982017c4c40241c752a9ff6751adcbc3135fe696eef9b47d7fe393dfd94968842dc15a16cdfd
7
- data.tar.gz: d1390c4599b34ee589afc80b54b3e64082d8fca0aa6e1d9568926e31e3c08ddffc0b94f75d22d6ee2ffeeac6791e41dff70ac0d9ee0283e5ef3619f62770a848
6
+ metadata.gz: 89f7a51168ddfdee7c17eb4f14d162b5ca936055715f1b6ec7d802da663f92ddfd4b61e02de00520f591287c557d479c6f53e91b14c19e346e6f40cae83b9abc
7
+ data.tar.gz: be0191fb1e249c9691ffd9a211b4f6658ccc151904baf4250a684f30d5433d8f9fd10fc70819a280b48b4077075ab4943350b80f59fc4336c40cee0108a35586
@@ -24,6 +24,10 @@ module TestLauncher
24
24
  def mtime
25
25
  @mtime ||= File.mtime(file)
26
26
  end
27
+
28
+ def relative_file
29
+ file.sub(/^#{File.join(app_root, '/')}/, '')
30
+ end
27
31
 
28
32
  def app_root
29
33
  if exploded_path.select { |dir| dir == test_root_dir_name }.size > 1
@@ -108,7 +108,7 @@ Open an issue on https://github.com/petekinnecom/test_launcher if this is someth
108
108
  end
109
109
 
110
110
  if test_case.spring_enabled?
111
- %{cd #{test_case.app_root} && TESTOPTS="--name='#{name_arg}'" #{test_case.example_runner} #{test_case.file}}
111
+ %{cd #{test_case.app_root} && TESTOPTS="--name='#{name_arg}'" #{test_case.example_runner} #{test_case.relative_file}}
112
112
  else
113
113
  %{cd #{test_case.app_root} && #{test_case.example_runner} #{test_case.file} --name='#{name_arg}'}
114
114
  end
@@ -124,7 +124,11 @@ Open an issue on https://github.com/petekinnecom/test_launcher if this is someth
124
124
  end
125
125
 
126
126
  def one_or_more_files(test_cases)
127
- %{cd #{test_cases.first.app_root} && #{test_cases.first.file_runner} #{test_cases.map(&:file).uniq.join(" ")}}
127
+ if test_cases.first.spring_enabled?
128
+ %{cd #{test_cases.first.app_root} && #{test_cases.first.file_runner} #{test_cases.map(&:relative_file).uniq.join(" ")}}
129
+ else
130
+ %{cd #{test_cases.first.app_root} && #{test_cases.first.file_runner} #{test_cases.map(&:file).uniq.join(" ")}}
131
+ end
128
132
  end
129
133
  end
130
134
 
@@ -1,3 +1,3 @@
1
1
  module TestLauncher
2
- VERSION = "2.12.0"
2
+ VERSION = "2.13.0"
3
3
  end
@@ -46,7 +46,8 @@ module TestLauncher
46
46
  example: "example_name",
47
47
  app_root: "app_root",
48
48
  file_runner: "file_runner",
49
- file: "file"
49
+ file: "file",
50
+ spring_enabled?: false
50
51
  )
51
52
  assert_equal "cd app_root && file_runner file", Runner.new.single_file(test_case)
52
53
  end
@@ -57,7 +58,8 @@ module TestLauncher
57
58
  example: "example_name",
58
59
  app_root: "app_root",
59
60
  file_runner: "file_runner",
60
- file: "file_1"
61
+ file: "file_1",
62
+ spring_enabled?: false
61
63
  ),
62
64
  MockTestCase.new(
63
65
  example: "example_name",
@@ -270,7 +270,7 @@ module TestLauncher
270
270
  end
271
271
 
272
272
  launch("class_1_test.rb", env: {}, searcher: searcher)
273
- assert_equal "cd /src && bundle exec spring rake test /src/test/class_1_test.rb", shell_mock.recall_exec
273
+ assert_equal "cd /src && bundle exec spring rake test test/class_1_test.rb", shell_mock.recall_exec
274
274
 
275
275
  launch("class_1_test.rb", env: {"DISABLE_SPRING" => "1"}, searcher: searcher)
276
276
  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
@@ -290,7 +290,7 @@ module TestLauncher
290
290
  end
291
291
 
292
292
  launch("class_1_test.rb --spring", env: {}, searcher: searcher)
293
- assert_equal "cd /src && bundle exec spring rake test /src/test/class_1_test.rb", shell_mock.recall_exec
293
+ assert_equal "cd /src && bundle exec spring rake test test/class_1_test.rb", shell_mock.recall_exec
294
294
  end
295
295
 
296
296
  def test__by_regex__one_match
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.12.0
4
+ version: 2.13.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-02-27 00:00:00.000000000 Z
11
+ date: 2018-02-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler