Name | Total Lines | Lines of Code | Total Coverage | Code Coverage |
---|---|---|---|---|
rcov/ruby/1.8/gems/rspec-core-2.5.1/lib/rspec/core/deprecation.rb | 45 | 32 | 26.67%
|
21.88%
|
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 |
3 class << self |
4 def deprecate(method, alternate_method=nil, version=nil) |
5 version_string = version ? "rspec-#{version}" : "a future version of RSpec" |
6 |
7 message = <<-NOTICE |
8 |
9 ***************************************************************** |
10 DEPRECATION WARNING: you are using deprecated behaviour that will |
11 be removed from #{version_string}. |
12 |
13 #{caller(0)[2]} |
14 |
15 * #{method} is deprecated. |
16 NOTICE |
17 if alternate_method |
18 message << <<-ADDITIONAL |
19 * please use #{alternate_method} instead. |
20 ADDITIONAL |
21 end |
22 |
23 message << "*****************************************************************" |
24 warn_deprecation(message) |
25 end |
26 |
27 def warn_deprecation(message) |
28 send :warn, message |
29 end |
30 end |
31 |
32 class HashWithDeprecationNotice < Hash |
33 |
34 def initialize(method, alternate_method=nil) |
35 @method, @alternate_method = method, alternate_method |
36 end |
37 |
38 def []=(k,v) |
39 RSpec.deprecate(@method, @alternate_method) |
40 super(k,v) |
41 end |
42 |
43 end |
44 |
45 end |
Generated on Fri Apr 22 17:22:41 -0700 2011 with rcov 0.9.8