minitest-utils 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/minitest/utils/reporter.rb +7 -3
- data/lib/minitest/utils/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 03a93deeaff791c6e0c463f3900a5ef73b2e9818
|
4
|
+
data.tar.gz: 65399906d8d423813fd89de0a92f3f092761c75d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c372c13681dd4f4d9a371affa37fe1f67b8459de91a26b244c3efc32e480f5fdc30e7beca387eaab88be22b4f0ad8d9454c572320e326f4a87cfbd4c62773002
|
7
|
+
data.tar.gz: b0669b26b8d42dc24728d9a7f802782c8ce90e40ebd9cb5f6d33e2b3e2258101e7424761e5adaeff7d501a04e6d85bb9e455b159fd0427961fd601b5392838a2
|
@@ -94,6 +94,8 @@ module Minitest
|
|
94
94
|
|
95
95
|
def display_replay_command(result)
|
96
96
|
location = find_test_file(result)
|
97
|
+
return if location.empty?
|
98
|
+
|
97
99
|
command = %[rake TEST=#{location} TESTOPTS="--name=#{result.name}"]
|
98
100
|
str = "\n"
|
99
101
|
str << color(command, :red)
|
@@ -104,17 +106,19 @@ module Minitest
|
|
104
106
|
def find_test_file(result)
|
105
107
|
filter_backtrace(result.failure.backtrace)
|
106
108
|
.find {|line| line.match(%r((test|spec)/.*?_(test|spec).rb)) }
|
109
|
+
.to_s
|
107
110
|
.gsub(/:\d+.*?$/, '')
|
108
111
|
end
|
109
112
|
|
110
113
|
def backtrace(backtrace)
|
111
|
-
backtrace = filter_backtrace(backtrace).map {|line| location(line) }
|
114
|
+
backtrace = filter_backtrace(backtrace).map {|line| location(line, true) }
|
112
115
|
return if backtrace.empty?
|
113
116
|
indent(backtrace.join("\n")).gsub(/^(\s+)/, "\\1# ")
|
114
117
|
end
|
115
118
|
|
116
|
-
def location(location)
|
117
|
-
|
119
|
+
def location(location, include_line_number = false)
|
120
|
+
regex = include_line_number ? /^([^:]+:\d+)/ : /^([^:]+)/
|
121
|
+
location = File.expand_path(location[regex, 1])
|
118
122
|
|
119
123
|
return location unless location.start_with?(Dir.pwd)
|
120
124
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: minitest-utils
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nando Vieira
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-05-
|
11
|
+
date: 2015-05-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: minitest
|