Jldrill Git C0 Coverage Information - RCov

lib/jldrill/spec/StoryMemento.rb

Name Total Lines Lines of Code Total Coverage Code Coverage
lib/jldrill/spec/StoryMemento.rb 61 45
100.00%
100.00%

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 'jldrill/contexts/MainContext'
2 require 'jldrill/spec/Fakes'
3 require 'jldrill/model/Config'
4 
5 module JLDrill
6     # This is a helper class for the tests.  It makes it
7     # easier to set up and tear down the test.  It also keeps track
8     # of the state of the app.
9     class StoryMemento
10         attr_reader :storyName, :app, :mainContext, 
11                     :mainView, :context, :view
12     
13         def initialize(storyName)
14             @storyName = storyName
15             restart
16         end
17 
18         def restart
19             @app = nil
20             @mainContext = nil
21             @mainView = nil
22             @context = nil
23             @view = nil
24         end
25         
26         def stepName(step)
27             @storyName + " - " + step
28         end
29 
30         def setup(type)
31             @app = JLDrill::Fakes::App.new(type, JLDrill::MainContext)
32             @mainContext = @app.mainContext
33             @mainView = @mainContext.peekAtView
34         end
35 
36         def useTestDictionary
37             # Override with the small test dictionary
38             rc = @mainContext.loadReferenceContext
39 			def rc.dictionaryName(options)
40 				testsDir = File.join(JLDrill::Config::DATA_DIR, "tests")
41 				return File.join(testsDir, "edict.utf")
42 			end
43         end
44         
45         def start
46             @app.enter
47         end
48                 
49         # This is very important to call when using setupGtk because otherwise
50         # you will leave windows hanging open.
51         def shutdown
52             @mainContext.exit
53             restart
54         end
55 
56         # Create a new view after the old one has been destroyed        
57         def getNewView
58             @view = @context.peekAtView
59         end
60     end
61 end

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