minitest-rerun 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/lib/minitest/rerun.rb +23 -8
- data/lib/minitest/rerun/version.rb +1 -1
- metadata +2 -2
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c4ea2c762b6dac4867ce48cf9c4579765c02b0bc
|
4
|
+
data.tar.gz: ef37a4b94ff22fbeb7f9e15cf89fffd791c25c25
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a2d5cf4c71ec1c5a2a7915116320b090320eda166f610e866a4af4585bd992873aaded1fbc02c2b978e210e66305d9137e150242cfbef9592dd61eabacf2c3cf
|
7
|
+
data.tar.gz: 26cc421fea4b0023ffa93c5b32cb0da5658c04b5a13ca6c7d18ab58e24923bfc34a522fb6d78d213825208b53c96ba0b18494ba48fdf3f032f4daa642c2d5247
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/lib/minitest/rerun.rb
CHANGED
@@ -2,23 +2,38 @@ require "minitest/rerun/version"
|
|
2
2
|
|
3
3
|
module Minitest::Rerun
|
4
4
|
class << self
|
5
|
+
ASCII_COLORS = {:red => 31, :cyan => 36}
|
6
|
+
|
5
7
|
def rerun_command(msg)
|
6
8
|
info = msg.to_s.split("\n")[1]
|
7
|
-
|
8
|
-
|
9
|
-
|
9
|
+
location_part = info[/ \[((.*?):\d+)\]:/]
|
10
|
+
location = $1
|
11
|
+
file = $2
|
12
|
+
if location
|
13
|
+
name = info.sub(location_part, "")
|
14
|
+
colorize(:red, "ruby #{test_file(file)} -n '#{name}' ") + colorize(:cyan, "# #{relativize(location)}")
|
15
|
+
end
|
10
16
|
end
|
11
17
|
|
12
18
|
private
|
13
19
|
|
14
|
-
def
|
15
|
-
|
16
|
-
|
17
|
-
tests_run.first
|
20
|
+
def colorize(color, string)
|
21
|
+
if $stdout.tty?
|
22
|
+
"\e[#{ASCII_COLORS[color]}m#{string}\e[0m"
|
18
23
|
else
|
19
|
-
|
24
|
+
string
|
20
25
|
end
|
21
26
|
end
|
27
|
+
|
28
|
+
def relativize(location)
|
29
|
+
location.sub(/^\.\//, "").sub("#{Dir.pwd}/", "")
|
30
|
+
end
|
31
|
+
|
32
|
+
def test_file(location)
|
33
|
+
tests_run = $0.split(" ").select { |f| File.exist?(f) }
|
34
|
+
location = tests_run.first if tests_run.size == 1
|
35
|
+
relativize(location)
|
36
|
+
end
|
22
37
|
end
|
23
38
|
|
24
39
|
module M4
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: minitest-rerun
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Grosser
|
@@ -30,7 +30,7 @@ cert_chain:
|
|
30
30
|
F5etKHZg0j3eHO31/i2HnswY04lqGImUu6aM5EnijFTB7PPW2KwKKM4+kKDYFdlw
|
31
31
|
/0WV1Ng2/Y6qsHwmqGg2VlYj2h4=
|
32
32
|
-----END CERTIFICATE-----
|
33
|
-
date: 2014-03-
|
33
|
+
date: 2014-03-31 00:00:00.000000000 Z
|
34
34
|
dependencies:
|
35
35
|
- !ruby/object:Gem::Dependency
|
36
36
|
name: minitest
|
metadata.gz.sig
CHANGED
Binary file
|