summaryrefslogtreecommitdiff
path: root/spec/ruby/core/kernel/fail_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/core/kernel/fail_spec.rb')
-rw-r--r--spec/ruby/core/kernel/fail_spec.rb17
1 files changed, 8 insertions, 9 deletions
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