C0 code coverage information
Generated on Mon Aug 13 01:18:53 -0400 2007 with rcov 0.8.0
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 Spec
2 module DSL
3 class Description
4 module ClassMethods
5 def generate_description(*args)
6 description = args.shift.to_s
7 unless args.empty?
8 suffix = args.shift.to_s
9 description << " " unless suffix =~ /^\s|\.|#/
10 description << suffix
11 end
12 description
13 end
14 end
15 extend ClassMethods
16
17 attr_reader :description, :described_type
18
19 def initialize(*args)
20 args, @options = args_and_options(*args)
21 init_behaviour_type(@options)
22 init_spec_path(@options)
23 init_described_type(args)
24 init_description(*args)
25 end
26
27 def [](key)
28 @options[key]
29 end
30
31 def []=(key, value)
32 @options[key] = value
33 end
34
35 def to_s; @description; end
36
37 def ==(value)
38 case value
39 when Description
40 @description == value.description
41 else
42 @description == value
43 end
44 end
45
46 private
47 def init_behaviour_type(options)
48 # NOTE - BE CAREFUL IF CHANGING THIS NEXT LINE:
49 # this line is as it is to satisfy JRuby - the original version
50 # read, simply: "if options[:behaviour_class]", which passed against ruby, but failed against jruby
51 if options[:behaviour_class] && options[:behaviour_class].ancestors.include?(Behaviour)
52 options[:behaviour_type] = parse_behaviour_type(@options[:behaviour_class])
53 end
54 end
55
56 def init_spec_path(options)
57 if options.has_key?(:spec_path)
58 options[:spec_path] = File.expand_path(@options[:spec_path])
59 end
60 end
61
62 def init_description(*args)
63 @description = self.class.generate_description(*args)
64 end
65
66 def init_described_type(args)
67 @described_type = args.first unless args.first.is_a?(String)
68 end
69
70 def parse_behaviour_type(behaviour_class)
71 behaviour_class.to_s.split("::").reverse[0].gsub!('Behaviour', '').downcase.to_sym
72 end
73
74 end
75 end
76 end
Generated using the rcov code coverage analysis tool for Ruby version 0.8.0.