fix a bug in `rake spec' which it would raise an ArgumentError when use "it" without block

A following spec will raise an ArgumentError.

	describe "Application 'test'" do
	  it "has one window"
	end

`instance_eval' will pass a receiver object into block.
When use a block which created by lambda, it should accept a receiver object as block parameter.

	b = lambda { self.upcase }
	"test".instance_eval(&b) #=> wrong number of arguments (1 for 0) (ArgumentError)
This commit is contained in:
Watson
2013-01-18 11:02:06 +09:00
parent 3898a9d1e7
commit 930de8070f

View File

@@ -490,7 +490,7 @@ module Bacon
def it(description, &block)
return unless description =~ RestrictName
block ||= lambda { should.flunk "not implemented" }
block ||= proc { should.flunk "not implemented" }
Counter[:specifications] += 1
@specifications << Specification.new(self, description, block, @before, @after)
end