RubySpec for creating a Proc using the block from an enclosing method #3203
+21
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This patch adds two matching RubySpec examples for
Proc.new
andKernel#proc
that specify their behavior when called without an explicit block. Both examples pass on MRI, but only theProc.new
version will pass on Rubinius. See the context at #3202.Kernel#proc
is effectively an alias forProc.new
, so it might make sense to move the examples inspec/ruby/core/proc/new_spec.rb
into a set of shared examples that are applied for both methods, but I opted not to do that without discussing it first and to keep this patch simple and small.