Abstracting Services In Ruby C0 Coverage Information - RCov

lib/asir/response.rb

Name Total Lines Lines of Code Total Coverage Code Coverage
lib/asir/response.rb 49 32
59.18%
40.62%

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 ASIR
2   # !SLIDE
3   # Response
4   #
5   # Encapsulate the response returned to the Client.
6   class Response
7     include AdditionalData, RequestIdentity
8     attr_accessor :request, :result, :exception
9     # Optional: Opaque data about the server that processed the Request.
10     attr_accessor :server
11 
12     def initialize req, res = nil, exc = nil
13       @request = req; @result = res
14       @exception = exc && EncapsulatedException.new(exc)
15       @identifier = @request.identifier
16     end
17 
18     def encode_more!
19       @request = @request.encode_more! if @request
20       self
21     end
22 
23     def decode_more!
24       @request = @request.decode_more! if @request
25       self
26     end
27   end
28   # !SLIDE END
29 
30   # !SLIDE
31   # Encapsulated Exception
32   #
33   # Encapsulates exceptions raised in the Service.
34   class EncapsulatedException
35     include ObjectResolving, AdditionalData
36     attr_accessor :exception_class, :exception_message, :exception_backtrace
37 
38     def initialize exc
39       @exception_class     = exc.class.name
40       @exception_message   = exc.message
41       @exception_backtrace = exc.backtrace
42     end
43 
44     def invoke!
45       raise resolve_object(@exception_class), @exception_message, @exception_backtrace
46     end
47   end
48   # !SLIDE END
49 end

Generated on Fri Jan 27 17:37:46 -0600 2012 with rcov 0.9.8