summaryrefslogtreecommitdiff
path: root/spec/ruby/core/class
diff options
context:
space:
mode:
authorBenoit Daloze <eregontp@gmail.com>2019-07-27 12:40:09 +0200
committerBenoit Daloze <eregontp@gmail.com>2019-07-27 12:40:09 +0200
commit5c276e1cc91c5ab2a41fbf7827af2fed914a2bc0 (patch)
tree05b5c68c8b2a00224d4646ea3b26ce3877efaadd /spec/ruby/core/class
parenta06301b103371b0b7da8eaca26ba744961769f99 (diff)
Update to ruby/spec@875a09e
Diffstat (limited to 'spec/ruby/core/class')
-rw-r--r--spec/ruby/core/class/allocate_spec.rb4
-rw-r--r--spec/ruby/core/class/inherited_spec.rb4
-rw-r--r--spec/ruby/core/class/initialize_spec.rb8
-rw-r--r--spec/ruby/core/class/new_spec.rb12
4 files changed, 14 insertions, 14 deletions
diff --git a/spec/ruby/core/class/allocate_spec.rb b/spec/ruby/core/class/allocate_spec.rb
index 4cf5665392..c426c38ff9 100644
--- a/spec/ruby/core/class/allocate_spec.rb
+++ b/spec/ruby/core/class/allocate_spec.rb
@@ -14,7 +14,7 @@ describe "Class#allocate" do
it "throws an exception when calling a method on a new instance" do
klass = Class.allocate
- lambda do
+ -> do
klass.new
end.should raise_error(Exception)
end
@@ -34,7 +34,7 @@ describe "Class#allocate" do
end
it "raises TypeError for #superclass" do
- lambda do
+ -> do
Class.allocate.superclass
end.should raise_error(TypeError)
end
diff --git a/spec/ruby/core/class/inherited_spec.rb b/spec/ruby/core/class/inherited_spec.rb
index fb7fb8e75a..8ef8bb8c35 100644
--- a/spec/ruby/core/class/inherited_spec.rb
+++ b/spec/ruby/core/class/inherited_spec.rb
@@ -92,10 +92,10 @@ describe "Class.inherited" do
end
class << top; private :inherited; end
- lambda { Class.new(top) }.should_not raise_error
+ -> { Class.new(top) }.should_not raise_error
class << top; protected :inherited; end
- lambda { Class.new(top) }.should_not raise_error
+ -> { Class.new(top) }.should_not raise_error
end
end
diff --git a/spec/ruby/core/class/initialize_spec.rb b/spec/ruby/core/class/initialize_spec.rb
index 88a9fcfa7a..9678d7b373 100644
--- a/spec/ruby/core/class/initialize_spec.rb
+++ b/spec/ruby/core/class/initialize_spec.rb
@@ -6,18 +6,18 @@ describe "Class#initialize" do
end
it "raises a TypeError when called on already initialized classes" do
- lambda{
+ ->{
Fixnum.send :initialize
}.should raise_error(TypeError)
- lambda{
+ ->{
Object.send :initialize
}.should raise_error(TypeError)
end
# See [redmine:2601]
it "raises a TypeError when called on BasicObject" do
- lambda{
+ ->{
BasicObject.send :initialize
}.should raise_error(TypeError)
end
@@ -28,7 +28,7 @@ describe "Class#initialize" do
end
it "raises a TypeError" do
- lambda{@uninitialized.send(:initialize, Class)}.should raise_error(TypeError)
+ ->{@uninitialized.send(:initialize, Class)}.should raise_error(TypeError)
end
end
end
diff --git a/spec/ruby/core/class/new_spec.rb b/spec/ruby/core/class/new_spec.rb
index 7f7ec183ea..8191ce6a37 100644
--- a/spec/ruby/core/class/new_spec.rb
+++ b/spec/ruby/core/class/new_spec.rb
@@ -70,7 +70,7 @@ describe "Class.new" do
it "raises a TypeError if passed a metaclass" do
obj = mock("Class.new metaclass")
meta = obj.singleton_class
- lambda { Class.new meta }.should raise_error(TypeError)
+ -> { Class.new meta }.should raise_error(TypeError)
end
it "creates a class without a name" do
@@ -96,11 +96,11 @@ describe "Class.new" do
it "raises a TypeError when given a non-Class" do
error_msg = /superclass must be a Class/
- lambda { Class.new("") }.should raise_error(TypeError, error_msg)
- lambda { Class.new(1) }.should raise_error(TypeError, error_msg)
- lambda { Class.new(:symbol) }.should raise_error(TypeError, error_msg)
- lambda { Class.new(mock('o')) }.should raise_error(TypeError, error_msg)
- lambda { Class.new(Module.new) }.should raise_error(TypeError, error_msg)
+ -> { Class.new("") }.should raise_error(TypeError, error_msg)
+ -> { Class.new(1) }.should raise_error(TypeError, error_msg)
+ -> { Class.new(:symbol) }.should raise_error(TypeError, error_msg)
+ -> { Class.new(mock('o')) }.should raise_error(TypeError, error_msg)
+ -> { Class.new(Module.new) }.should raise_error(TypeError, error_msg)
end
end