C0 code coverage information
Generated on Sat Feb 02 17:44:27 +0100 2008 with rcov 0.8.1.2
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 # Copyright (c) 2008 Michael Fellinger m.fellinger@gmail.com
2 # All files in this distribution are subject to the terms of the Ruby license.
3
4 class Array
5 def put_within(object, constrain)
6 pre, post = constrain.values_at(:after, :before)
7
8 unless rindex(post) - index(pre) == 1
9 raise ArgumentError, "Too many elements within constrain"
10 end
11
12 put_after(pre, object)
13 end
14
15 def put_after(element, object)
16 raise ArgumentError, "The given element doesn't exist" unless include?(element)
17 self[index(element) + 1, 0] = object
18 end
19
20 def put_before(element, object)
21 raise ArgumentError, "The given element doesn't exist" unless include?(element)
22 self[rindex(element), 0] = object
23 end
24 end
Generated using the rcov code coverage analysis tool for Ruby version 0.8.1.2.