C0 code coverage information
Generated on Thu Dec 13 20:44:49 -0200 2007 with rcov 0.8.1.2
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.
| Name |
Total lines |
Lines of code |
Total coverage |
Code coverage |
|
lib/hand.rb
|
22
|
18
|
|
|
1 require 'enumerator'
2
3 class Hand
4 include Comparable
5 attr_reader :cards, :type
6
7 def initialize(str)
8 @cards = str.split.map {|s| Card.new(s)}.sort
9 [HandType, Pair, TwoPairs, ThreeOfAKind, Straight, Flush].each do |candidate|
10 type = candidate.new(@cards)
11 @type = type if type.accept?
12 end
13 end
14
15 def rank
16 @type.rank
17 end
18
19 def <=>(other)
20 self.rank <=> other.rank
21 end
22 end
Generated using the rcov code coverage analysis tool for Ruby version 0.8.1.2.