diff options
author | Jean Boussier <[email protected]> | 2024-03-14 15:50:19 +0100 |
---|---|---|
committer | Jean Boussier <[email protected]> | 2024-03-18 08:55:46 +0100 |
commit | 8a8df4917488ff1c8034119a94216f1b04ed3bfc (patch) | |
tree | d274d2a5f6d41d4c62626a925b796df50c24d0a7 /spec/ruby/shared/kernel | |
parent | 454b939d7c9223ca04aa06a79939187ee6f3396c (diff) |
Update set_backtrace documentation
Followup: https://github.com/ruby/ruby/pull/10017
[Feature #13557]
Diffstat (limited to 'spec/ruby/shared/kernel')
-rw-r--r-- | spec/ruby/shared/kernel/raise.rb | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/spec/ruby/shared/kernel/raise.rb b/spec/ruby/shared/kernel/raise.rb index 4b60951f24..1917a4c923 100644 --- a/spec/ruby/shared/kernel/raise.rb +++ b/spec/ruby/shared/kernel/raise.rb @@ -148,10 +148,13 @@ describe :kernel_raise, shared: true do end ruby_version_is "3.4" do + locations = caller_locations(1, 2) it "allows Exception, message, and backtrace_locations parameters" do -> do - @object.raise(ArgumentError, "message", caller_locations) - end.should raise_error(ArgumentError, "message") + @object.raise(ArgumentError, "message", locations) + end.should raise_error(ArgumentError, "message") { |error| + error.backtrace_locations.map(&:to_s).should == locations.map(&:to_s) + } end end end |