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 Expectations
3 # rspec adds #should and #should_not to every Object (and,
4 # implicitly, every Class).
5 module ObjectExpectations
6
7 # :call-seq:
8 # should(matcher)
9 # should == expected
10 # should === expected
11 # should =~ expected
12 #
13 # receiver.should(matcher)
14 # => Passes if matcher.matches?(receiver)
15 #
16 # receiver.should == expected #any value
17 # => Passes if (receiver == expected)
18 #
19 # receiver.should === expected #any value
20 # => Passes if (receiver === expected)
21 #
22 # receiver.should =~ regexp
23 # => Passes if (receiver =~ regexp)
24 #
25 # See Spec::Matchers for more information about matchers
26 #
27 # == Warning
28 #
29 # NOTE that this does NOT support receiver.should != expected.
30 # Instead, use receiver.should_not == expected
31 def should(matcher=nil, &block)
32 return ExpectationMatcherHandler.handle_matcher(self, matcher, &block) if matcher
33 Spec::Matchers::PositiveOperatorMatcher.new(self)
34 end
35
36 # :call-seq:
37 # should_not(matcher)
38 # should_not == expected
39 # should_not === expected
40 # should_not =~ expected
41 #
42 # receiver.should_not(matcher)
43 # => Passes unless matcher.matches?(receiver)
44 #
45 # receiver.should_not == expected
46 # => Passes unless (receiver == expected)
47 #
48 # receiver.should_not === expected
49 # => Passes unless (receiver === expected)
50 #
51 # receiver.should_not =~ regexp
52 # => Passes unless (receiver =~ regexp)
53 #
54 # See Spec::Matchers for more information about matchers
55 def should_not(matcher=nil, &block)
56 return NegativeExpectationMatcherHandler.handle_matcher(self, matcher, &block) if matcher
57 Spec::Matchers::NegativeOperatorMatcher.new(self)
58 end
59
60 end
61 end
62 end
63
64 class Object
65 include Spec::Expectations::ObjectExpectations
66 end
Generated using the rcov code coverage analysis tool for Ruby version 0.8.0.