1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
This commit is contained in:
Benoit Daloze 2019-07-27 12:40:09 +02:00
parent a06301b103
commit 5c276e1cc9
1247 changed files with 5316 additions and 5028 deletions

View file

@ -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