Jldrill Git C0 Coverage Information - RCov

lib/jldrill/views/gtk/widgets/PromptWindow.rb

Name Total Lines Lines of Code Total Coverage Code Coverage
lib/jldrill/views/gtk/widgets/PromptWindow.rb 35 31
34.29%
25.81%

Key

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.

Coverage Details

1 require 'Context/Gtk/Widget'
2 require 'gtk2'
3 
4 module JLDrill::Gtk
5     class PromptWindow < Gtk::Dialog
6         include Context::Gtk::Widget
7 
8         attr_reader :response
9         
10         def initialize(view, title, message)
11             @view = view
12             @response = @view.context.cancel
13             super(title, nil,
14                   Gtk::Dialog::DESTROY_WITH_PARENT,
15                   [Gtk::Stock::CANCEL, Gtk::Dialog::RESPONSE_CANCEL],
16                   [Gtk::Stock::NO, Gtk::Dialog::RESPONSE_NO],
17                   [Gtk::Stock::YES, Gtk::Dialog::RESPONSE_YES])
18             self.vbox.add(Gtk::Label.new(message))
19         end
20         
21         def execute
22             self.run do |response|
23                 case response
24                 when Gtk::Dialog::RESPONSE_YES
25                     @response = @view.context.yes
26                 when Gtk::Dialog::RESPONSE_NO 
27                     @response = @view.context.no
28                 else 
29                     @response = @view.context.cancel
30                 end
31             end
32             @response
33         end
34     end	    
35 end

Generated on Mon May 23 16:17:47 +0900 2011 with rcov 0.9.8