diff options
Diffstat (limited to 'spec/ruby/core/kernel/singleton_class_spec.rb')
| -rw-r--r-- | spec/ruby/core/kernel/singleton_class_spec.rb | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/spec/ruby/core/kernel/singleton_class_spec.rb b/spec/ruby/core/kernel/singleton_class_spec.rb index 23c400f9bd..7915272937 100644 --- a/spec/ruby/core/kernel/singleton_class_spec.rb +++ b/spec/ruby/core/kernel/singleton_class_spec.rb @@ -21,27 +21,27 @@ describe "Kernel#singleton_class" do end it "raises TypeError for Integer" do - -> { 123.singleton_class }.should raise_error(TypeError, "can't define singleton") + -> { 123.singleton_class }.should.raise(TypeError, "can't define singleton") end it "raises TypeError for Float" do - -> { 3.14.singleton_class }.should raise_error(TypeError, "can't define singleton") + -> { 3.14.singleton_class }.should.raise(TypeError, "can't define singleton") end it "raises TypeError for Symbol" do - -> { :foo.singleton_class }.should raise_error(TypeError, "can't define singleton") + -> { :foo.singleton_class }.should.raise(TypeError, "can't define singleton") end it "raises TypeError for a frozen deduplicated String" do - -> { (-"string").singleton_class }.should raise_error(TypeError, "can't define singleton") - -> { a = -"string"; a.singleton_class }.should raise_error(TypeError, "can't define singleton") - -> { a = "string"; (-a).singleton_class }.should raise_error(TypeError, "can't define singleton") + -> { (-"string").singleton_class }.should.raise(TypeError, "can't define singleton") + -> { a = -"string"; a.singleton_class }.should.raise(TypeError, "can't define singleton") + -> { a = "string"; (-a).singleton_class }.should.raise(TypeError, "can't define singleton") end it "returns a frozen singleton class if object is frozen" do obj = Object.new obj.freeze - obj.singleton_class.frozen?.should be_true + obj.singleton_class.frozen?.should == true end context "for an IO object with a replaced singleton class" do |
