minitest-check 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 055592ca4baf16a6dffc2ebdedc7527af28732f8
4
- data.tar.gz: 49082898a189979ed651d9ae292fe63654fb8fe2
3
+ metadata.gz: 3f3c7d6524ee47a298c293a92bf4faa96cf3832b
4
+ data.tar.gz: f1890379b803b5795f69a56b54aca68f02650b01
5
5
  SHA512:
6
- metadata.gz: c600fa8a481f693bb5191c0447159536897521b2b342a012051111c445679fcfe93238173bcce7c377f7f3601a672b8bd6036c6075619a22a088ecbc7e736a12
7
- data.tar.gz: 61933fbd71e0d460db24612f8de1339f0ae6a9824205aeaa3c97ad295fbf2e5205a63a93dfd2bf4511fb481a82bf522272fecc3b6b6214ae385baee05bf252a6
6
+ metadata.gz: 5c8f8091ed2053652ac52c5df0afcb7e053c5cd96288d36e8fd80301afab6c53faad81adf5e9afdaccb173b594edec3900bbc691bcdcf958233d5bc9fed91a5d
7
+ data.tar.gz: 26f46bb7e14f00075ef805150043f67cca26a88b1c94fec3d58ba47ec24e5cf621118f30a1502a751bf96c5cd93e4986a0951d212de964654f1cf3d1f39b3655
@@ -157,24 +157,26 @@ module MiniTest
157
157
  def draw_graph(pairs, io, max_width = 80)
158
158
  if pairs
159
159
  data_groups = pairs.group_by {|d| d[1] == 1 ? :singles : :multis }
160
- data = data_groups[:multis].to_a.sort {|a,b| b[1] <=> a[1]}
161
- largest_value_width = data.map {|d| d[0].length}.max
162
- largest_num = data[0][1]
163
- scale = if largest_num > 0
164
- (max_width - largest_value_width - 3).to_f / largest_num.to_f
165
- else
166
- 0
167
- end
168
-
169
- data.each do |(value, num)|
170
- num_string = num.to_s
171
- num_length = num_string.length
172
- bar_length = (num.to_f * scale).to_i
173
- fill_length = bar_length - num_length
174
- if fill_length > 0
175
- io.puts "#{value.to_s.ljust(largest_value_width)} | #{num_string}#{'#' * fill_length}"
160
+ if multis = data_groups[:multis]
161
+ data = multis.to_a.sort {|a,b| b[1] <=> a[1]}
162
+ largest_value_width = data.map {|d| d[0].length}.max
163
+ largest_num = data[0][1]
164
+ scale = if largest_num > 0
165
+ (max_width - largest_value_width - 3).to_f / largest_num.to_f
176
166
  else
177
- io.puts "#{value.to_s.ljust(largest_value_width)} | #{'#' * bar_length} (#{num_string})"
167
+ 0
168
+ end
169
+
170
+ data.each do |(value, num)|
171
+ num_string = num.to_s
172
+ num_length = num_string.length
173
+ bar_length = (num.to_f * scale).to_i
174
+ fill_length = bar_length - num_length
175
+ if fill_length > 0
176
+ io.puts "#{value.to_s.ljust(largest_value_width)} | #{num_string}#{'#' * fill_length}"
177
+ else
178
+ io.puts "#{value.to_s.ljust(largest_value_width)} | #{'#' * bar_length} (#{num_string})"
179
+ end
178
180
  end
179
181
  end
180
182
 
@@ -1,5 +1,5 @@
1
1
  module Minitest
2
2
  module Check
3
- VERSION = "0.0.1"
3
+ VERSION = "0.0.2"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: minitest-check
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew O'Brien
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2013-06-10 00:00:00 Z
12
+ date: 2013-06-25 00:00:00 Z
13
13
  dependencies: []
14
14
 
15
15
  description: Generative testing for Minitest.