Geminstaller C0 Coverage Information - RCov

/Users/woolley/.rvm/gems/ruby-1.8.7-p174@geminstaller/gems/rspec-1.3.0/lib/spec/example/example_methods.rb

Name Total Lines Lines of Code Total Coverage Code Coverage
/Users/woolley/.rvm/gems/ruby-1.8.7-p174@geminstaller/gems/rspec-1.3.0/lib/spec/example/example_methods.rb 152 112
76.97%
69.64%

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 module Spec
2   module Example
3     module ExampleMethods
4 
5       extend  Spec::Example::ModuleReopeningFix
6       include Spec::Example::Subject::ExampleMethods
7 
8       def violated(message="")
9         raise Spec::Expectations::ExpectationNotMetError.new(message)
10       end
11 
12       # Declared description for this example:
13       #
14       #   describe Account do
15       #     it "should start with a balance of 0" do
16       #     ...
17       #
18       #   description
19       #   => "should start with a balance of 0"
20       def description
21         if description = @_proxy.description || ::Spec::Matchers.generated_description
22           description
23         else
24           Spec.warn Spec::Example::NoDescriptionError.message("example", @_proxy.location)
25         end
26       end
27 
28       def options # :nodoc:
29         @_proxy.options
30       end
31 
32       def execute(run_options, instance_variables) # :nodoc:
33         run_options.reporter.example_started(@_proxy)
34         set_instance_variables_from_hash(instance_variables)
35 
36         execution_error = nil
37         Timeout.timeout(run_options.timeout) do
38           begin
39             before_each_example
40             instance_eval(&@_implementation)
41           rescue Interrupt
42             exit 1
43           rescue Exception => e
44             execution_error ||= e
45           end
46           begin
47             after_each_example
48           rescue Interrupt
49             exit 1
50           rescue Exception => e
51             execution_error ||= e
52           end
53         end
54 
55         run_options.reporter.example_finished(@_proxy.update(description), execution_error)
56         success = execution_error.nil? || ExamplePendingError === execution_error
57       end
58 
59       module BlockAliases
60         alias_method :to,     :should
61         alias_method :to_not, :should_not
62       end
63 
64       # Extends the submitted block with aliases to and to_not
65       # for should and should_not. Allows expectations like this:
66       #
67       #   expect { this_block }.to change{this.expression}.from(old_value).to(new_value)
68       #   expect { this_block }.to raise_error
69       def expect(&block)
70         block.extend BlockAliases
71       end
72 
73       def eval_each_fail_fast(blocks) # :nodoc:
74         blocks.each {|block| instance_eval(&block)}
75       end
76 
77       def eval_each_fail_slow(blocks) # :nodoc:
78         first_exception = nil
79         blocks.each do |block|
80           begin
81             instance_eval(&block)
82           rescue Exception => e
83             first_exception ||= e
84           end
85         end
86         raise first_exception if first_exception
87       end
88 
89       def instance_variable_hash # :nodoc:
90         instance_variables.inject({}) do |variable_hash, variable_name|
91           variable_hash[variable_name] = instance_variable_get(variable_name)
92           variable_hash
93         end
94       end
95 
96       def set_instance_variables_from_hash(ivars) # :nodoc:
97         ivars.each do |variable_name, value|
98           # Ruby 1.9 requires variable.to_s on the next line
99           unless ['@_proxy', '@_implementation', '@method_name'].include?(variable_name.to_s)
100             instance_variable_set variable_name, value
101           end
102         end
103       end
104 
105       # Run all the before(:each) blocks for this example
106       def run_before_each
107         example_group_hierarchy.run_before_each(self)
108       end
109 
110       # Run all the after(:each) blocks for this example
111       def run_after_each
112         example_group_hierarchy.run_after_each(self)
113       end
114 
115       def initialize(example_proxy, &implementation)
116         @_proxy = example_proxy
117         @_implementation = implementation
118         @_backtrace = caller
119       end
120       
121     private
122 
123       include Matchers
124       include Pending
125 
126       def before_each_example
127         setup_mocks_for_rspec
128         run_before_each
129       end
130 
131       def after_each_example
132         run_after_each
133         verify_mocks_for_rspec
134       ensure
135         teardown_mocks_for_rspec
136       end
137 
138       def described_class
139         self.class.described_class
140       end
141 
142       def description_args
143         self.class.description_args
144       end
145 
146       def example_group_hierarchy
147         self.class.example_group_hierarchy
148       end
149 
150     end
151   end
152 end

Generated on Mon May 10 23:40:27 -0700 2010 with rcov 0.9.8