aboutsummaryrefslogtreecommitdiffstats
path: root/spec/ruby/core/module/shared/class_eval.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/core/module/shared/class_eval.rb')
-rw-r--r--spec/ruby/core/module/shared/class_eval.rb14
1 files changed, 7 insertions, 7 deletions
diff --git a/spec/ruby/core/module/shared/class_eval.rb b/spec/ruby/core/module/shared/class_eval.rb
index 6bb9668fee..08f8ff7597 100644
--- a/spec/ruby/core/module/shared/class_eval.rb
+++ b/spec/ruby/core/module/shared/class_eval.rb
@@ -14,7 +14,7 @@ describe :module_class_eval, shared: true do
'foo'
end
end
- lambda {42.foo}.should raise_error(NoMethodError)
+ -> {42.foo}.should raise_error(NoMethodError)
end
it "resolves constants in the caller scope" do
@@ -59,7 +59,7 @@ describe :module_class_eval, shared: true do
it "raises a TypeError when the given filename can't be converted to string using to_str" do
(file = mock('123')).should_receive(:to_str).and_return(123)
- lambda { ModuleSpecs.send(@method, "1+1", file) }.should raise_error(TypeError)
+ -> { ModuleSpecs.send(@method, "1+1", file) }.should raise_error(TypeError)
end
it "converts non string eval-string to string using to_str" do
@@ -69,24 +69,24 @@ describe :module_class_eval, shared: true do
it "raises a TypeError when the given eval-string can't be converted to string using to_str" do
o = mock('x')
- lambda { ModuleSpecs.send(@method, o) }.should raise_error(TypeError)
+ -> { ModuleSpecs.send(@method, o) }.should raise_error(TypeError)
(o = mock('123')).should_receive(:to_str).and_return(123)
- lambda { ModuleSpecs.send(@method, o) }.should raise_error(TypeError)
+ -> { ModuleSpecs.send(@method, o) }.should raise_error(TypeError)
end
it "raises an ArgumentError when no arguments and no block are given" do
- lambda { ModuleSpecs.send(@method) }.should raise_error(ArgumentError)
+ -> { ModuleSpecs.send(@method) }.should raise_error(ArgumentError)
end
it "raises an ArgumentError when more than 3 arguments are given" do
- lambda {
+ -> {
ModuleSpecs.send(@method, "1 + 1", "some file", 0, "bogus")
}.should raise_error(ArgumentError)
end
it "raises an ArgumentError when a block and normal arguments are given" do
- lambda {
+ -> {
ModuleSpecs.send(@method, "1 + 1") { 1 + 1 }
}.should raise_error(ArgumentError)
end