summaryrefslogtreecommitdiff
path: root/spec/rubyspec/core/exception/equal_value_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/rubyspec/core/exception/equal_value_spec.rb')
-rw-r--r--spec/rubyspec/core/exception/equal_value_spec.rb68
1 files changed, 0 insertions, 68 deletions
diff --git a/spec/rubyspec/core/exception/equal_value_spec.rb b/spec/rubyspec/core/exception/equal_value_spec.rb
deleted file mode 100644
index 3aad809377..0000000000
--- a/spec/rubyspec/core/exception/equal_value_spec.rb
+++ /dev/null
@@ -1,68 +0,0 @@
-require File.expand_path('../../../spec_helper', __FILE__)
-require File.expand_path('../fixtures/common', __FILE__)
-
-describe "Exception#==" do
- it "returns true if both exceptions are the same object" do
- e = ArgumentError.new
- e.should == e
- end
-
- it "returns true if one exception is the dup'd copy of the other" do
- e = ArgumentError.new
- e.should == e.dup
- end
-
- it "returns true if both exceptions have the same class, no message, and no backtrace" do
- RuntimeError.new.should == RuntimeError.new
- end
-
- it "returns true if both exceptions have the same class, the same message, and no backtrace" do
- TypeError.new("message").should == TypeError.new("message")
- end
-
- it "returns true if both exceptions have the same class, the same message, and the same backtrace" do
- one = TypeError.new("message")
- one.set_backtrace [File.dirname(__FILE__)]
- two = TypeError.new("message")
- two.set_backtrace [File.dirname(__FILE__)]
- one.should == two
- end
-
- it "returns false if the two exceptions inherit from Exception but have different classes" do
- one = RuntimeError.new("message")
- one.set_backtrace [File.dirname(__FILE__)]
- one.should be_kind_of(Exception)
- two = TypeError.new("message")
- two.set_backtrace [File.dirname(__FILE__)]
- two.should be_kind_of(Exception)
- one.should_not == two
- end
-
- it "returns true if the two objects subclass Exception and have the same message and backtrace" do
- one = ExceptionSpecs::UnExceptional.new
- two = ExceptionSpecs::UnExceptional.new
- one.message.should == two.message
- two.backtrace.should == two.backtrace
- one.should == two
- end
-
- it "returns false if the argument is not an Exception" do
- ArgumentError.new.should_not == String.new
- end
-
- it "returns false if the two exceptions differ only in their backtrace" do
- one = RuntimeError.new("message")
- one.set_backtrace [File.dirname(__FILE__)]
- two = RuntimeError.new("message")
- two.set_backtrace nil
- one.should_not == two
- end
-
- it "returns false if the two exceptions differ only in their message" do
- one = RuntimeError.new("message")
- one.set_backtrace [File.dirname(__FILE__)]
- two = RuntimeError.new("message2")
- two.set_backtrace [File.dirname(__FILE__)]
- one.should_not == two
- end
-end