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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0e87fddbab7df2853bed9f6bf8663d78de2158ee
4
- data.tar.gz: e478d871df3ac79bf3583f01edfaa4ccbfac4e21
3
+ metadata.gz: cca8306d12fc9bb10a491a8427d715ec1c213099
4
+ data.tar.gz: efdc3a74a5abc2749ad8ac4c950ca53d3d94104c
5
5
  SHA512:
6
- metadata.gz: 72d781cb7c5686eb4091d79f218572960176ee49e14b59c0cf1103230a403ad0077ec17029ef12dddd55aa5f82be825bb1348168db9ab33810253745e9c075b2
7
- data.tar.gz: cbb8502cb6e9ab2d9afa12cd17d5bdf1283edb680c0664a6ea7539ff08026a97c187d6936d45d2c5e9c69157bb9b7fd0043c95b3b770a30157e40e3735343a17
6
+ metadata.gz: 7d203b48a5dea5b6f7026c85f9714970a0d78f5f785a88a05dccc7e16f516b0da4b71b5db0a7d88d41df529fb9a434e1761dc7f10150474a6bb3d7ff7291231c
7
+ data.tar.gz: 27dedefadbaa245ee2fb05c81d5ed44245df7d8b7e3bddcf8c24e5aa6b9e9c6184f66f65551f6721df6240354267229f25112ed053bcb3522f0d3c87c09c4a12
data/.gitignore CHANGED
@@ -12,3 +12,4 @@
12
12
  *.o
13
13
  *.a
14
14
  mkmf.log
15
+ *.sublime-*
@@ -1,3 +1,3 @@
1
1
  module RspecErrorSummary
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
@@ -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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rspec_error_summary
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jose Santiago