test_launcher 2.21.0 → 2.22.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: 06b235fa2c06c8c943187511a5e9d59ffe5ce01f
4
- data.tar.gz: 34105a1658d9d0152ac73bbc64d643aec0b73b6f
3
+ metadata.gz: 256bfd0bb5b9a996cdbdfca0fdc997899af37fa7
4
+ data.tar.gz: fe76b7af2796e558507f01c39cf8fb3ec1eeef99
5
5
  SHA512:
6
- metadata.gz: 4e07fa6bb4ccc1933b27ccd24ef1d814b8cbfc7f89eb707d0ef75f5c29bfc794bcc1d3ba0f9d82a09068679c01f0ad027d91c2858a5a635b56cf2c2a55db6470
7
- data.tar.gz: fb39961d66baaba90e75ff23c73c14f35d0716f3c7e642bfdbec65811460301eae9a33b2bda6f78025b13107a26da482f29cb8a351538a02c2d09a4b4b3b916c
6
+ metadata.gz: 79eed606a7d7f4e76e3119459a58efeba96ca3da0d2ccc6d3ac6b2ab5349c95ea5f83c7769d1be1aac5761733aec2fb66ba0d54a4ec58ff45b9fe3c726074b84
7
+ data.tar.gz: 41089357c7b6c4f89000989a17d7cac731f4b3d47b3c168c91bc90f52367093476b238039603f94c75686cd389d66767ae0a60f64948b2ecbbb1043157598a58
@@ -1,5 +1,3 @@
1
- require "pathname"
2
-
3
1
  module TestLauncher
4
2
  module Frameworks
5
3
  module Implementation
@@ -24,7 +22,7 @@ module TestLauncher
24
22
  def mtime
25
23
  @mtime ||= File.mtime(file)
26
24
  end
27
-
25
+
28
26
  def relative_file
29
27
  file.sub(/^#{File.join(app_root, '/')}/, '')
30
28
  end
@@ -56,7 +54,7 @@ module TestLauncher
56
54
  end
57
55
 
58
56
  def exploded_path
59
- Pathname.new(file).each_filename.to_a
57
+ file.split("/")
60
58
  end
61
59
  end
62
60
  end
@@ -45,9 +45,16 @@ module TestLauncher
45
45
  .min_by {|r| line_number - r[:line_number]}
46
46
 
47
47
  if best_result
48
+ example_name =
49
+ if match = best_result[:line].match(/def\s+(?<name>test_[\w\?]+)/)
50
+ match[:name]
51
+ elsif match = best_result[:line].match(/test\s+['"](?<name>.*)['"]\s+do/)
52
+ "test_#{match[:name]}"
53
+ end
54
+
48
55
  [{
49
56
  file: best_result[:file],
50
- example_name: best_result[:line].match(/(def\s+(?<name>test_[\w\?]+)|test\s+['"](?<name>.*)['"]\s+do)/)[:name],
57
+ example_name: example_name,
51
58
  line_number: best_result[:line_number]
52
59
  }]
53
60
  else
@@ -1,5 +1,4 @@
1
1
  require "test_launcher/shell/color"
2
- require "bundler"
3
2
  require "shellwords"
4
3
 
5
4
  module TestLauncher
@@ -1,3 +1,3 @@
1
1
  module TestLauncher
2
- VERSION = "2.21.0"
2
+ VERSION = "2.22.0"
3
3
  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.21.0
4
+ version: 2.22.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-30 00:00:00.000000000 Z
11
+ date: 2019-03-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler