aboutsummaryrefslogtreecommitdiffstats
path: root/spec/ruby/core/kernel/eval_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/core/kernel/eval_spec.rb')
-rw-r--r--spec/ruby/core/kernel/eval_spec.rb12
1 files changed, 6 insertions, 6 deletions
diff --git a/spec/ruby/core/kernel/eval_spec.rb b/spec/ruby/core/kernel/eval_spec.rb
index 696c55a3ba..9442725eac 100644
--- a/spec/ruby/core/kernel/eval_spec.rb
+++ b/spec/ruby/core/kernel/eval_spec.rb
@@ -76,12 +76,12 @@ describe "Kernel#eval" do
x = 1
bind = proc {}
- lambda { eval("x", bind) }.should raise_error(TypeError)
+ -> { eval("x", bind) }.should raise_error(TypeError)
end
it "does not make Proc locals visible to evaluated code" do
bind = proc { inner = 4 }
- lambda { eval("inner", bind.binding) }.should raise_error(NameError)
+ -> { eval("inner", bind.binding) }.should raise_error(NameError)
end
# REWRITE ME: This obscures the real behavior of where locals are stored
@@ -134,7 +134,7 @@ describe "Kernel#eval" do
it "includes file and line information in syntax error" do
expected = 'speccing.rb'
- lambda {
+ -> {
eval('if true',TOPLEVEL_BINDING, expected)
}.should raise_error(SyntaxError) { |e|
e.message.should =~ /#{expected}:1:.+/
@@ -143,7 +143,7 @@ describe "Kernel#eval" do
it "evaluates string with given filename and negative linenumber" do
expected_file = 'speccing.rb'
- lambda {
+ -> {
eval('if true',TOPLEVEL_BINDING, expected_file, -100)
}.should raise_error(SyntaxError) { |e|
e.message.should =~ /#{expected_file}:-100:.+/
@@ -195,13 +195,13 @@ describe "Kernel#eval" do
end
it "does not pass the block to the method being eval'ed" do
- lambda {
+ -> {
eval('KernelSpecs::EvalTest.call_yield') { "content" }
}.should raise_error(LocalJumpError)
end
it "returns from the scope calling #eval when evaluating 'return'" do
- lambda { eval("return :eval") }.call.should == :eval
+ -> { eval("return :eval") }.call.should == :eval
end
it "unwinds through a Proc-style closure and returns from a lambda-style closure in the closure chain" do