7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
# File 'lib/caricature/bacon/integration.rb', line 7
def satisfy(*args, &block)
if args.size == 1 && String === args.first
description = args.shift
else
description = ""
end
r=nil
err = nil
begin
r = yield(@object, *args)
rescue Caricature::ArgumentMatchError => e
err =e
end
if Bacon::Counter[:depth] > 0
Bacon::Counter[:requirements] += 1
raise (err.is_a?(Caricature::ArgumentMatchError) ? err : Bacon::Error.new(:failed, description)) unless @negated ^ r
r
else
@negated ? !r : !!r
end
end
|