Geminstaller C0 Coverage Information - RCov

/Users/woolley/.rvm/gems/ruby-1.8.7-p174@geminstaller/gems/rspec-1.3.0/lib/spec/expectations/fail_with.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/expectations/fail_with.rb 45 37
24.44%
13.51%

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 Expectations
3     class << self
4       attr_accessor :differ
5       
6       # raises a Spec::Expectations::ExpectationNotMetError with message
7       #
8       # When a differ has been assigned and fail_with is passed
9       # <code>expected</code> and <code>target</code>, passes them
10       # to the differ to append a diff message to the failure message.
11       def fail_with(message, expected=nil, target=nil) # :nodoc:
12         if message.nil?
13           raise ArgumentError, "Failure message is nil. Does your matcher define the " +
14                                "appropriate failure_message_for_* method to return a string?"
15         end
16         if (Array === message) & (message.length == 3)
17           ::Spec.warn(<<-NOTICE
18 
19 *****************************************************************
20 DEPRECATION WARNING: you are using deprecated behaviour that will
21 be removed from a future version of RSpec.
22 
23 * Support for matchers that return arrays from failure message
24 methods is deprecated.
25 * Instead, the matcher should return a string, and expose methods
26 for the expected() and actual() values.
27 *****************************************************************
28 NOTICE
29           )
30           message, expected, target = message[0], message[1], message[2]
31         end
32         unless (differ.nil? || expected.nil? || target.nil?)
33           if expected.is_a?(String)
34             message << "\n\n Diff:" << self.differ.diff_as_string(target.to_s, expected)
35           elsif expected.is_a?(Hash) && target.is_a?(Hash)
36             message << "\n\n Diff:" << self.differ.diff_as_hash(target, expected)
37           elsif !target.is_a?(Proc)
38             message << "\n\n Diff:" << self.differ.diff_as_object(target, expected)
39           end
40         end
41         Kernel::raise(Spec::Expectations::ExpectationNotMetError.new(message))
42       end
43     end
44   end
45 end

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