diff options
author | eregon <eregon@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-11-27 20:38:57 +0000 |
---|---|---|
committer | eregon <eregon@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-11-27 20:38:57 +0000 |
commit | 50441014ffd3645f258e56b9415b7787c910408b (patch) | |
tree | 3d5eef5ad1ea7e389dc51fc87437664b984ac184 /spec/ruby/shared/kernel | |
parent | 49cd16bfaf4f03885058ce748119bc8ea2de735a (diff) |
Update to ruby/spec@cdd6ff7
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66041 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'spec/ruby/shared/kernel')
-rw-r--r-- | spec/ruby/shared/kernel/raise.rb | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/spec/ruby/shared/kernel/raise.rb b/spec/ruby/shared/kernel/raise.rb index 4128a636ad..3cff55ac6e 100644 --- a/spec/ruby/shared/kernel/raise.rb +++ b/spec/ruby/shared/kernel/raise.rb @@ -44,11 +44,11 @@ describe :kernel_raise, shared: true do it "re-raises the previously rescued exception if no exception is specified" do lambda do begin - raise Exception, "outer" + @object.raise Exception, "outer" ScratchPad.record :no_abort rescue begin - raise StandardError, "inner" + @object.raise StandardError, "inner" rescue end @@ -62,16 +62,17 @@ describe :kernel_raise, shared: true do it "re-raises a previously rescued exception without overwriting the backtrace" do begin - raise 'raised' + initial_raise_line = __LINE__; @object.raise 'raised' rescue => raised begin - raise_again_line = __LINE__; raise raised + raise_again_line = __LINE__; @object.raise raised rescue => raised_again # This spec is written using #backtrace and matching the line number # from the string, as backtrace_locations is a more advanced # method that is not always supported by implementations. - raised_again.backtrace.first.should_not include(":#{raise_again_line}:") + raised_again.backtrace.first.should include("#{__FILE__}:#{initial_raise_line}:") + raised_again.backtrace.first.should_not include("#{__FILE__}:#{raise_again_line}:") end end end |