summaryrefslogtreecommitdiff
path: root/spec/ruby/core/kernel/lambda_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/core/kernel/lambda_spec.rb')
-rw-r--r--spec/ruby/core/kernel/lambda_spec.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/spec/ruby/core/kernel/lambda_spec.rb b/spec/ruby/core/kernel/lambda_spec.rb
index 52f340dde5..4796d65352 100644
--- a/spec/ruby/core/kernel/lambda_spec.rb
+++ b/spec/ruby/core/kernel/lambda_spec.rb
@@ -16,6 +16,21 @@ describe "Kernel.lambda" do
l.lambda?.should be_true
end
+ it "creates a lambda-style Proc if given a literal block via #send" do
+ l = send(:lambda) { 42 }
+ l.lambda?.should be_true
+ end
+
+ it "creates a lambda-style Proc if given a literal block via #__send__" do
+ l = __send__(:lambda) { 42 }
+ l.lambda?.should be_true
+ end
+
+ it "creates a lambda-style Proc if given a literal block via Kernel.public_send" do
+ l = Kernel.public_send(:lambda) { 42 }
+ l.lambda?.should be_true
+ end
+
it "returned the passed Proc if given an existing Proc" do
some_proc = proc {}
l = lambda(&some_proc)