C0 code coverage information
Generated on Thu Jun 07 11:34:00 -0400 2007 with rcov 0.8.0
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 class TeamResult < ActiveRecord::Base
2 belongs_to :team
3 belongs_to :game
4 belongs_to :tournament
5
6 validates_numericality_of :powers, :tossups, :negs, :only_integer => :true, :gte => 0
7
8 def lose
9 !win and !tie
10 end
11
12 def name
13 team.name
14 end
15
16 def round
17 game.round
18 end
19
20 def bonuses_heard
21 self.powers + self.tossups
22 end
23
24 def bonus_points
25 score - (powers * 15) - (tossups * 10) + (negs * 5)
26 end
27
28 def bonus_conversion
29 bonus_points.to_f / bonuses_heard.to_f
30 end
31
32 def points_against
33 game.team_results.select{|k| k!= self}[0].score
34 end
35
36 def points_per_tuh
37 score.to_f / tuh.to_f
38 end
39
40 def opponent
41 game.team_results.select{|k|k.id != id}[0].team
42 end
43
44 protected
45 def players=(presults)
46 true
47 end
48 end
Generated using the rcov code coverage analysis tool for Ruby version 0.8.0.