summaryrefslogtreecommitdiff
path: root/spec/ruby/language/singleton_class_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/language/singleton_class_spec.rb')
-rw-r--r--spec/ruby/language/singleton_class_spec.rb18
1 files changed, 9 insertions, 9 deletions
diff --git a/spec/ruby/language/singleton_class_spec.rb b/spec/ruby/language/singleton_class_spec.rb
index e3a0d2870b..df735018af 100644
--- a/spec/ruby/language/singleton_class_spec.rb
+++ b/spec/ruby/language/singleton_class_spec.rb
@@ -15,11 +15,11 @@ describe "A singleton class" do
end
it "raises a TypeError for Fixnum's" do
- lambda { 1.singleton_class }.should raise_error(TypeError)
+ -> { 1.singleton_class }.should raise_error(TypeError)
end
it "raises a TypeError for symbols" do
- lambda { :symbol.singleton_class }.should raise_error(TypeError)
+ -> { :symbol.singleton_class }.should raise_error(TypeError)
end
it "is a singleton Class instance" do
@@ -74,7 +74,7 @@ describe "A singleton class" do
end
it "doesn't have singleton class" do
- lambda { bignum_value.singleton_class.superclass.should == Bignum }.should raise_error(TypeError)
+ -> { bignum_value.singleton_class.superclass.should == Bignum }.should raise_error(TypeError)
end
end
@@ -112,11 +112,11 @@ describe "A constant on a singleton class" do
class << @object
CONST
end
- lambda { CONST }.should raise_error(NameError)
+ -> { CONST }.should raise_error(NameError)
end
it "cannot be accessed via object::CONST" do
- lambda do
+ -> do
@object::CONST
end.should raise_error(TypeError)
end
@@ -127,7 +127,7 @@ describe "A constant on a singleton class" do
CONST = 100
end
- lambda do
+ -> do
@object::CONST
end.should raise_error(NameError)
end
@@ -143,7 +143,7 @@ describe "A constant on a singleton class" do
it "is not preserved when the object is duped" do
@object = @object.dup
- lambda do
+ -> do
class << @object; CONST; end
end.should raise_error(NameError)
end
@@ -280,13 +280,13 @@ end
describe "Instantiating a singleton class" do
it "raises a TypeError when new is called" do
- lambda {
+ -> {
Object.new.singleton_class.new
}.should raise_error(TypeError)
end
it "raises a TypeError when allocate is called" do
- lambda {
+ -> {
Object.new.singleton_class.allocate
}.should raise_error(TypeError)
end