lib/ae/subjunctive.rb in ae-1.6.0 vs lib/ae/subjunctive.rb in ae-1.6.1
- old
+ new
@@ -18,11 +18,11 @@
#
# 5.should.be Numeric
#
def be(*args, &block)
return self if args.empty? && !block
- block = args.shift if !block_given? && ::Proc === args.first
+ block = args.shift if !block && ::Proc === args.first
if block
pass = block.arity > 0 ? block.call(@delegate) : block.call #@delegate.instance_eval(&block)
msg = args.shift || @message || block.inspect
else
pass = args.shift.equate?(@delegate)
@@ -41,10 +41,10 @@
# The indefinite article is like #be, excpet that it compares a lone argument
# with #case?, rather than #equate?
#
def a(*args, &block)
return self if args.empty? && !block
- block = args.shift if !block_given? && ::Proc === args.first
+ block = args.shift if !block && ::Proc === args.first
if block
pass = block.arity > 0 ? block.call(@delegate) : block.call #@delegate.instance_eval(&block)
msg = args.shift || @message || block.inspect
else
pass = (args.shift === @delegate) # case equality