diff options
| author | Benoit Daloze <eregontp@gmail.com> | 2019-07-27 12:40:09 +0200 |
|---|---|---|
| committer | Benoit Daloze <eregontp@gmail.com> | 2019-07-27 12:40:09 +0200 |
| commit | 5c276e1cc91c5ab2a41fbf7827af2fed914a2bc0 (patch) | |
| tree | 05b5c68c8b2a00224d4646ea3b26ce3877efaadd /spec/ruby/core/module/shared | |
| parent | a06301b103371b0b7da8eaca26ba744961769f99 (diff) | |
Update to ruby/spec@875a09e
Diffstat (limited to 'spec/ruby/core/module/shared')
| -rw-r--r-- | spec/ruby/core/module/shared/class_eval.rb | 14 | ||||
| -rw-r--r-- | spec/ruby/core/module/shared/class_exec.rb | 4 |
2 files changed, 9 insertions, 9 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 diff --git a/spec/ruby/core/module/shared/class_exec.rb b/spec/ruby/core/module/shared/class_exec.rb index c5c18b0a34..c7a9e5297f 100644 --- a/spec/ruby/core/module/shared/class_exec.rb +++ b/spec/ruby/core/module/shared/class_exec.rb @@ -5,7 +5,7 @@ describe :module_class_exec, shared: true do 'foo' end end - lambda {42.foo}.should raise_error(NoMethodError) + -> {42.foo}.should raise_error(NoMethodError) end it "defines method in the receiver's scope" do @@ -19,7 +19,7 @@ describe :module_class_exec, shared: true do end it "raises a LocalJumpError when no block is given" do - lambda { ModuleSpecs::Subclass.send(@method) }.should raise_error(LocalJumpError) + -> { ModuleSpecs::Subclass.send(@method) }.should raise_error(LocalJumpError) end it "passes arguments to the block" do |
