Abstracting Services In Ruby C0 Coverage Information - RCov

lib/asir/uuid.rb

Name Total Lines Lines of Code Total Coverage Code Coverage
lib/asir/uuid.rb 32 20
71.88%
55.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 ASIR
2 # Provides an RFC4122-compliant random (version 4) UUID service.
3 module UUID
4   # Return an RFC4122-compliant random (version 4) UUID,
5   # represented as a string of 36 characters.
6   #
7   # Possible (but unlikely!) return value:
8   #   "e29fc859-8d6d-4c5d-aa5a-1ab726f4a192".
9   #
10   # Possible exceptions:
11   #   Errno::ENOENT
12   #
13   PROC_SYS_FILE = "/proc/sys/kernel/random/uuid".freeze
14   case
15   when File.exist?(PROC_SYS_FILE)
16     def self.generate
17       File.read(PROC_SYS_FILE).chomp!
18     end
19   when (gem 'uuid' rescue nil)
20     require 'uuid'
21     def self.generate
22       ::UUID.generate
23     end
24   else
25     def self.generate
26       raise "Unimplemented"
27     end
28   end
29 end
30 end
31 
32 

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