From da7976235fbc2986925969646071bebe3702e49f Mon Sep 17 00:00:00 2001 From: eregon Date: Thu, 21 Feb 2019 15:38:59 +0000 Subject: Update to ruby/spec@7a16e01 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67112 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- spec/ruby/core/kernel/fail_spec.rb | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'spec/ruby/core/kernel/fail_spec.rb') diff --git a/spec/ruby/core/kernel/fail_spec.rb b/spec/ruby/core/kernel/fail_spec.rb index 01dffa4a69..a5948cefae 100644 --- a/spec/ruby/core/kernel/fail_spec.rb +++ b/spec/ruby/core/kernel/fail_spec.rb @@ -1,7 +1,7 @@ require_relative '../../spec_helper' require_relative 'fixtures/classes' -describe "Kernel.fail" do +describe "Kernel#fail" do it "is a private method" do Kernel.should have_private_instance_method(:fail) end @@ -11,17 +11,16 @@ describe "Kernel.fail" do end it "accepts an Object with an exception method returning an Exception" do - class Boring - def self.exception(msg) - StandardError.new msg - end + obj = Object.new + def obj.exception(msg) + StandardError.new msg end - lambda { fail Boring, "..." }.should raise_error(StandardError) + lambda { fail obj, "..." }.should raise_error(StandardError, "...") end it "instantiates the specified exception class" do - class LittleBunnyFooFoo < RuntimeError; end - lambda { fail LittleBunnyFooFoo }.should raise_error(LittleBunnyFooFoo) + error_class = Class.new(RuntimeError) + lambda { fail error_class }.should raise_error(error_class) end it "uses the specified message" do @@ -38,6 +37,6 @@ describe "Kernel.fail" do end end -describe "Kernel#fail" do +describe "Kernel.fail" do it "needs to be reviewed for spec completeness" end -- cgit v1.2.3