We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 70c78f0 commit b16a93eCopy full SHA for b16a93e
language/predefined_spec.rb
@@ -1,4 +1,5 @@
1
require_relative '../spec_helper'
2
+require_relative '../core/exception/shared/set_backtrace'
3
require 'stringio'
4
5
# The following tables are excerpted from Programming Ruby: The Pragmatic Programmer's Guide'
@@ -621,6 +622,17 @@ def foo
621
622
end
623
624
625
+ it_behaves_like :exception_set_backtrace, ->(*backtrace) {
626
+ exception = nil
627
+ begin
628
+ raise
629
+ rescue
630
+ $@ = backtrace.first unless backtrace.empty?
631
+ exception = $!
632
+ end
633
+ exception
634
+ }
635
+
636
it "cannot be assigned when there is no a rescued exception" do
637
-> {
638
$@ = []
0 commit comments