aboutsummaryrefslogtreecommitdiffstats
path: root/spec/ruby/core/proc/new_spec.rb
diff options
context:
space:
mode:
authorBenoit Daloze <eregontp@gmail.com>2019-05-28 22:41:48 +0200
committerBenoit Daloze <eregontp@gmail.com>2019-05-28 22:41:48 +0200
commita66bc2c01194a9c017c874a30db5b3b6bd95e966 (patch)
tree598d6375b44fd86f90c3477c73086f6fcf08d76c /spec/ruby/core/proc/new_spec.rb
parentd070523e7be4b95914adeef9a10401fba7718c5a (diff)
downloadruby-a66bc2c01194a9c017c874a30db5b3b6bd95e966.tar.gz
Update to ruby/spec@9a501a8
Diffstat (limited to 'spec/ruby/core/proc/new_spec.rb')
-rw-r--r--spec/ruby/core/proc/new_spec.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/spec/ruby/core/proc/new_spec.rb b/spec/ruby/core/proc/new_spec.rb
index 7579bfe1b6..60a7320e4b 100644
--- a/spec/ruby/core/proc/new_spec.rb
+++ b/spec/ruby/core/proc/new_spec.rb
@@ -190,6 +190,17 @@ describe "Proc.new without a block" do
prc.call.should == "hello"
end
+
+ it "uses the implicit block from an enclosing method when called inside a block" do
+ def some_method
+ proc do |&block|
+ Proc.new
+ end.call { "failing" }
+ end
+ prc = some_method { "hello" }
+
+ prc.call.should == "hello"
+ end
end
ruby_version_is "2.7" do