Rspec Steps C0 Coverage Information - RCov

rcov/ruby/1.8/gems/rspec-expectations-2.5.0/lib/rspec/matchers/generated_descriptions.rb

Name Total Lines Lines of Code Total Coverage Code Coverage
rcov/ruby/1.8/gems/rspec-expectations-2.5.0/lib/rspec/matchers/generated_descriptions.rb 36 27
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 module RSpec
2   module Matchers
3     class << self
4       attr_accessor :last_matcher, :last_should # :nodoc:
5     end
6 
7     def self.clear_generated_description
8       self.last_matcher = nil
9       self.last_should = nil
10     end
11 
12     def self.generated_description
13       return nil if last_should.nil?
14       "#{last_should.to_s.gsub('_',' ')} #{last_description}"
15     end
16     
17   private
18     
19     def self.last_description
20       last_matcher.respond_to?(:description) ? last_matcher.description : <<-MESSAGE
21 When you call a matcher in an example without a String, like this:
22 
23 specify { object.should matcher }
24 
25 or this:
26 
27 it { should matcher }
28 
29 RSpec expects the matcher to have a #description method. You should either
30 add a String to the example this matcher is being used in, or give it a
31 description method. Then you won't have to suffer this lengthy warning again.
32 MESSAGE
33     end
34   end
35 end
36       

Generated on Fri Apr 22 17:22:42 -0700 2011 with rcov 0.9.8