Name | Total Lines | Lines of Code | Total Coverage | Code Coverage |
---|---|---|---|---|
rcov/ruby/1.8/gems/rspec-expectations-2.5.0/lib/rspec/matchers/pretty.rb | 37 | 35 | 43.24%
|
40.00%
|
Code reported as executed by Ruby looks like this...and this: this line is also marked as covered.Lines considered as run by rcov, but not reported by Ruby, look like this,and this: these lines were inferred by rcov (using simple heuristics).Finally, here's a line marked as not executed.
1 module RSpec |
2 module Matchers |
3 module Pretty |
4 def split_words(sym) |
5 sym.to_s.gsub(/_/,' ') |
6 end |
7 |
8 def to_sentence(words) |
9 words = words.map{|w| w.inspect} |
10 case words.length |
11 when 0 |
12 "" |
13 when 1 |
14 " #{words[0]}" |
15 when 2 |
16 " #{words[0]} and #{words[1]}" |
17 else |
18 " #{words[0...-1].join(', ')}, and #{words[-1]}" |
19 end |
20 end |
21 |
22 def _pretty_print(array) |
23 result = "" |
24 array.each_with_index do |item, index| |
25 if index < (array.length - 2) |
26 result << "#{item.inspect}, " |
27 elsif index < (array.length - 1) |
28 result << "#{item.inspect} and " |
29 else |
30 result << "#{item.inspect}" |
31 end |
32 end |
33 result |
34 end |
35 end |
36 end |
37 end |
Generated on Fri Apr 22 17:22:41 -0700 2011 with rcov 0.9.8