rspec_error_summary 0.0.2 → 0.0.3
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
- data/.gitignore +1 -0
- data/lib/rspec_error_summary/version.rb +1 -1
- data/lib/rspec_error_summary.rb +9 -5
- 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: cca8306d12fc9bb10a491a8427d715ec1c213099
|
4
|
+
data.tar.gz: efdc3a74a5abc2749ad8ac4c950ca53d3d94104c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7d203b48a5dea5b6f7026c85f9714970a0d78f5f785a88a05dccc7e16f516b0da4b71b5db0a7d88d41df529fb9a434e1761dc7f10150474a6bb3d7ff7291231c
|
7
|
+
data.tar.gz: 27dedefadbaa245ee2fb05c81d5ed44245df7d8b7e3bddcf8c24e5aa6b9e9c6184f66f65551f6721df6240354267229f25112ed053bcb3522f0d3c87c09c4a12
|
data/.gitignore
CHANGED
data/lib/rspec_error_summary.rb
CHANGED
@@ -37,10 +37,14 @@ module RspecErrorSummary
|
|
37
37
|
|
38
38
|
failure_messages = failed_tests.map do |test|
|
39
39
|
# Consume the failed tests and provide a more simplified hash with just the required info
|
40
|
+
|
41
|
+
# Strip out the line breaks and replace standard space indents with tabs
|
40
42
|
msg = test[:exception][:message].gsub("\n", " ").gsub(" ", "\n\t\t ").strip
|
41
43
|
test_split = msg.split("#<")
|
42
44
|
|
43
|
-
if(test_split.count > 1 && test_split[0] != "")
|
45
|
+
if(test_split.count > 1 && test_split[0] != "" && !options[:verbose])
|
46
|
+
# Indicate that there is more to the message to be seen using the verbose flag
|
47
|
+
# or by running rspec manually on the affected files
|
44
48
|
msg = test_split[0] + "..."
|
45
49
|
end
|
46
50
|
|
@@ -49,6 +53,7 @@ module RspecErrorSummary
|
|
49
53
|
file_path: test[:file_path],
|
50
54
|
line_number: test[:line_number]
|
51
55
|
}
|
56
|
+
|
52
57
|
end
|
53
58
|
|
54
59
|
uniq_failure_messages = failure_messages.uniq { |test| test[:message] }
|
@@ -70,11 +75,11 @@ module RspecErrorSummary
|
|
70
75
|
|
71
76
|
end
|
72
77
|
|
78
|
+
# Sort by number of occurrences in descending order
|
73
79
|
uniq_failure_messages_for_output.sort!{ |a,b| b[:count].to_i <=> a[:count].to_i }
|
74
80
|
|
75
81
|
# Empty space between any normal RSpec output and our custom text
|
76
|
-
puts "
|
77
|
-
puts " "
|
82
|
+
puts "\n\n"
|
78
83
|
puts "Failure message report:"
|
79
84
|
if uniq_failure_messages_for_output.count == 0
|
80
85
|
puts ("Either no failures in the specified tests, or the desired error you entered could not be found in the results").colorize(:green)
|
@@ -91,8 +96,7 @@ module RspecErrorSummary
|
|
91
96
|
end
|
92
97
|
end
|
93
98
|
end
|
94
|
-
puts "
|
95
|
-
puts " "
|
99
|
+
puts "\n\n"
|
96
100
|
|
97
101
|
end
|
98
102
|
end
|