mirror of
https://github.com/zhigang1992/RubyMotion.git
synced 2026-06-16 21:21:56 +08:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user