Name | Total Lines | Lines of Code | Total Coverage | Code Coverage |
---|---|---|---|---|
rcov/ruby/1.8/gems/rspec-core-2.5.1/lib/rspec/core/pending.rb | 30 | 26 | 70.00%
|
65.38%
|
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 module RSpec |
2 module Core |
3 module Pending |
4 DEFAULT_MESSAGE = 'No reason given' |
5 |
6 def pending(*args) |
7 return self.class.before(:each) { pending(*args) } unless example |
8 |
9 options = args.last.is_a?(Hash) ? args.pop : {} |
10 message = args.first || DEFAULT_MESSAGE |
11 |
12 if options[:unless] || (options.has_key?(:if) && !options[:if]) |
13 return block_given? ? yield : nil |
14 end |
15 |
16 example.metadata[:pending] = true |
17 example.metadata[:execution_result][:pending_message] = message |
18 if block_given? |
19 begin |
20 result = yield |
21 example.metadata[:pending] = false |
22 rescue Exception => e |
23 end |
24 raise RSpec::Core::PendingExampleFixedError.new if result |
25 end |
26 throw :pending_declared_in_example, message |
27 end |
28 end |
29 end |
30 end |
Generated on Fri Apr 22 17:22:42 -0700 2011 with rcov 0.9.8