matest 1.6.4 → 1.6.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/matest +1 -23
- data/lib/matest/example_group.rb +1 -1
- data/lib/matest/skipped_example_group.rb +1 -1
- data/lib/matest/spec_printer.rb +30 -16
- data/lib/matest/spec_status.rb +13 -5
- data/lib/matest/version.rb +1 -1
- data/spec/matest_specs/nested_scopes_spec.rb +1 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 36062f8b707332afa8c056e0fa968518dcd9086b
|
4
|
+
data.tar.gz: 752248ac4ba6c9e4004c6b94d28f2516e8a43dac
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9b6dca03db53a6ff0fc0259a706fa0b1780eff0faa887b5be4287c0b511ef9f6e52dfb22c8d28796b4a8eda967f09fa6d0a294769e26cb671f1e18ede19d6e4c
|
7
|
+
data.tar.gz: a6ba560b0816ce402402fd8fab385cdf006e3dca350c3fd0f8bac978bbf340c89e03811d156e6aec9ac21b9a791492c02a43d8ecd0fa5f46d85657ef4e2b1737
|
data/bin/matest
CHANGED
@@ -24,26 +24,4 @@ runner.execute!
|
|
24
24
|
|
25
25
|
time_elapsed = Time.now - start_time
|
26
26
|
|
27
|
-
|
28
|
-
info = runner.info
|
29
|
-
|
30
|
-
def spec_detail(info)
|
31
|
-
info[:num_specs].map { |name, num|
|
32
|
-
" #{num} #{name.downcase}."
|
33
|
-
}.join("\n")
|
34
|
-
end
|
35
|
-
|
36
|
-
good_bye_message = <<-EOF
|
37
|
-
------------------------------------------
|
38
|
-
Specs:
|
39
|
-
#{spec_detail(info)}
|
40
|
-
|
41
|
-
EOF
|
42
|
-
|
43
|
-
puts good_bye_message
|
44
|
-
|
45
|
-
time_elapsed = Time.now - start_time
|
46
|
-
puts "Elapsed: #{time_elapsed} seconds."
|
47
|
-
|
48
|
-
|
49
|
-
exit(1) unless info[:success]
|
27
|
+
exit(1) unless runner.info[:success]
|
data/lib/matest/example_group.rb
CHANGED
data/lib/matest/spec_printer.rb
CHANGED
@@ -4,12 +4,12 @@ module Matest
|
|
4
4
|
class SpecPrinter
|
5
5
|
include Color
|
6
6
|
|
7
|
-
def
|
8
|
-
send(colors[res.class], res.to_s)
|
7
|
+
def prints(res)
|
8
|
+
print send(colors[res.class], res.to_s)
|
9
9
|
end
|
10
10
|
|
11
11
|
def print_messages(runner)
|
12
|
-
puts "\n\n### Messages ###"
|
12
|
+
puts header("\n\n### Messages ###")
|
13
13
|
|
14
14
|
statuses = []
|
15
15
|
runner.info[:success] = true
|
@@ -19,8 +19,8 @@ module Matest
|
|
19
19
|
current_group.statuses.each do |status|
|
20
20
|
runner.info[:num_specs][:total] += 1
|
21
21
|
|
22
|
-
runner.info[:num_specs][status.
|
23
|
-
runner.info[:num_specs][status.
|
22
|
+
runner.info[:num_specs][status.class] ||= 0
|
23
|
+
runner.info[:num_specs][status.class] += 1
|
24
24
|
|
25
25
|
if !status.is_a?(Matest::SpecPassed)
|
26
26
|
puts send(colors[status.class], "\n[#{status.name}] #{status.description}")
|
@@ -48,7 +48,7 @@ module Matest
|
|
48
48
|
end
|
49
49
|
if status.is_a?(Matest::NotANaturalAssertion)
|
50
50
|
runner.info[:success] = false
|
51
|
-
puts " # => #{status.result.inspect}"
|
51
|
+
puts " # => #{status.result.inspect}", reset("")
|
52
52
|
print_explanation_for(status)
|
53
53
|
end
|
54
54
|
if status.is_a?(Matest::ExceptionRaised)
|
@@ -57,11 +57,19 @@ module Matest
|
|
57
57
|
status.result.backtrace.each do |l|
|
58
58
|
puts error(" #{l}")
|
59
59
|
end
|
60
|
-
|
61
60
|
end
|
62
61
|
end
|
63
62
|
end
|
64
63
|
end
|
64
|
+
puts nil, "-"*50, nil
|
65
|
+
puts "Specs:"
|
66
|
+
|
67
|
+
p runner.info
|
68
|
+
runner.info[:num_specs].each { |klass, num|
|
69
|
+
puts send(colors[klass], " #{num} #{klass.to_s.downcase}.")
|
70
|
+
}
|
71
|
+
|
72
|
+
|
65
73
|
end
|
66
74
|
|
67
75
|
def print_explanation_for(status)
|
@@ -99,7 +107,7 @@ module Matest
|
|
99
107
|
private
|
100
108
|
|
101
109
|
def header(str)
|
102
|
-
str + ":"
|
110
|
+
white(str + ":")
|
103
111
|
end
|
104
112
|
|
105
113
|
def expression(str)
|
@@ -111,7 +119,7 @@ module Matest
|
|
111
119
|
end
|
112
120
|
|
113
121
|
def key_value(key, value)
|
114
|
-
" #{yellow(key.to_s)} #{bright_black("=>")} #{blue(value.inspect)}"
|
122
|
+
" #{yellow(key.to_s)} #{bright_black("=>")} #{blue(value.inspect)}#{reset("")}"
|
115
123
|
end
|
116
124
|
|
117
125
|
def error(str)
|
@@ -119,13 +127,19 @@ module Matest
|
|
119
127
|
end
|
120
128
|
|
121
129
|
def colors
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
130
|
+
@colors ||= get_colors
|
131
|
+
end
|
132
|
+
|
133
|
+
def get_colors
|
134
|
+
h = Hash.new(:white)
|
135
|
+
|
136
|
+
h[Matest::SpecPassed] = :green
|
137
|
+
h[Matest::SpecFailed] = :red
|
138
|
+
h[Matest::SpecSkipped] = :yellow
|
139
|
+
h[Matest::NotANaturalAssertion] = :cyan
|
140
|
+
h[Matest::ExceptionRaised] = :magenta
|
141
|
+
|
142
|
+
h
|
129
143
|
end
|
130
144
|
end
|
131
145
|
end
|
data/lib/matest/spec_status.rb
CHANGED
@@ -15,6 +15,14 @@ module Matest
|
|
15
15
|
def description
|
16
16
|
example.description
|
17
17
|
end
|
18
|
+
|
19
|
+
def name
|
20
|
+
self.class.name
|
21
|
+
end
|
22
|
+
|
23
|
+
def self.to_s
|
24
|
+
name
|
25
|
+
end
|
18
26
|
end
|
19
27
|
|
20
28
|
class SpecPassed < SpecStatus
|
@@ -22,7 +30,7 @@ module Matest
|
|
22
30
|
"."
|
23
31
|
end
|
24
32
|
|
25
|
-
def name
|
33
|
+
def self.name
|
26
34
|
"PASSING"
|
27
35
|
end
|
28
36
|
end
|
@@ -32,7 +40,7 @@ module Matest
|
|
32
40
|
"F"
|
33
41
|
end
|
34
42
|
|
35
|
-
def name
|
43
|
+
def self.name
|
36
44
|
"FAILING"
|
37
45
|
end
|
38
46
|
end
|
@@ -42,7 +50,7 @@ module Matest
|
|
42
50
|
"S"
|
43
51
|
end
|
44
52
|
|
45
|
-
def name
|
53
|
+
def self.name
|
46
54
|
"SKIPPED"
|
47
55
|
end
|
48
56
|
end
|
@@ -51,7 +59,7 @@ module Matest
|
|
51
59
|
"N"
|
52
60
|
end
|
53
61
|
|
54
|
-
def name
|
62
|
+
def self.name
|
55
63
|
"NOT A NATURAL ASSERTION"
|
56
64
|
end
|
57
65
|
end
|
@@ -62,7 +70,7 @@ module Matest
|
|
62
70
|
"E"
|
63
71
|
end
|
64
72
|
|
65
|
-
def name
|
73
|
+
def self.name
|
66
74
|
"ERROR"
|
67
75
|
end
|
68
76
|
end
|
data/lib/matest/version.rb
CHANGED