# File lib/spec/matchers/be.rb, line 150
150: def description
151: "#{prefix_to_sentence}#{expected_to_sentence}#{args_to_sentence}"
152: end
# File lib/spec/matchers/be.rb, line 142
142: def failure_message_for_should
143: "expected #{predicate}#{args_to_s} to return true, got #{@result.inspect}"
144: end
# File lib/spec/matchers/be.rb, line 146
146: def failure_message_for_should_not
147: "expected #{predicate}#{args_to_s} to return false, got #{@result.inspect}"
148: end
# File lib/spec/matchers/be.rb, line 127
127: def matches?(actual)
128: @actual = actual
129: begin
130: return @result = actual.__send__(predicate, *@args, &@block)
131: rescue NameError => predicate_missing_error
132: "this needs to be here or rcov will not count this branch even though it's executed in a code example"
133: end
134:
135: begin
136: return @result = actual.__send__(present_tense_predicate, *@args, &@block)
137: rescue NameError
138: raise predicate_missing_error
139: end
140: end
# File lib/spec/matchers/be.rb, line 164
164: def parse_expected(expected)
165: @prefix, expected = prefix_and_expected(expected)
166: expected
167: end
# File lib/spec/matchers/be.rb, line 156
156: def predicate
157: "#{@expected}?".to_sym
158: end
# File lib/spec/matchers/be.rb, line 169
169: def prefix_and_expected(symbol)
170: symbol.to_s =~ /^(be_(an?_)?)(.*)/
171: return $1, $3
172: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.