summaryrefslogtreecommitdiff
path: root/spec/ruby/core/exception/shared
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/core/exception/shared')
-rw-r--r--spec/ruby/core/exception/shared/new.rb4
-rw-r--r--spec/ruby/core/exception/shared/set_backtrace.rb10
2 files changed, 7 insertions, 7 deletions
diff --git a/spec/ruby/core/exception/shared/new.rb b/spec/ruby/core/exception/shared/new.rb
index bcde8ee4b2..048fd14dd2 100644
--- a/spec/ruby/core/exception/shared/new.rb
+++ b/spec/ruby/core/exception/shared/new.rb
@@ -1,6 +1,6 @@
describe :exception_new, shared: true do
it "creates a new instance of Exception" do
- Exception.should be_ancestor_of(Exception.send(@method).class)
+ Exception.send(@method).class.ancestors.should.include?(Exception)
end
it "sets the message of the Exception when passes a message" do
@@ -12,7 +12,7 @@ describe :exception_new, shared: true do
end
it "returns the exception when it has a custom constructor" do
- ExceptionSpecs::ConstructorException.send(@method).should be_kind_of(ExceptionSpecs::ConstructorException)
+ ExceptionSpecs::ConstructorException.send(@method).should.is_a?(ExceptionSpecs::ConstructorException)
end
end
diff --git a/spec/ruby/core/exception/shared/set_backtrace.rb b/spec/ruby/core/exception/shared/set_backtrace.rb
index c6213b42b4..934bf3dc5f 100644
--- a/spec/ruby/core/exception/shared/set_backtrace.rb
+++ b/spec/ruby/core/exception/shared/set_backtrace.rb
@@ -43,22 +43,22 @@ describe :exception_set_backtrace, shared: true do
it "accepts nil" do
err = @method.call(nil)
- err.backtrace.should be_nil
+ err.backtrace.should == nil
end
it "raises a TypeError when passed a Symbol" do
- -> { @method.call(:unhappy) }.should raise_error(TypeError)
+ -> { @method.call(:unhappy) }.should.raise(TypeError)
end
it "raises a TypeError when the Array contains a Symbol" do
- -> { @method.call(["String", :unhappy]) }.should raise_error(TypeError)
+ -> { @method.call(["String", :unhappy]) }.should.raise(TypeError)
end
it "raises a TypeError when the array contains nil" do
- -> { @method.call(["String", nil]) }.should raise_error(TypeError)
+ -> { @method.call(["String", nil]) }.should.raise(TypeError)
end
it "raises a TypeError when the argument is a nested array" do
- -> { @method.call(["String", ["String"]]) }.should raise_error(TypeError)
+ -> { @method.call(["String", ["String"]]) }.should.raise(TypeError)
end
end