File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -21,12 +21,16 @@ def raise_wrapped
21
21
RUBY
22
22
lines = ruby_exe ( code , args : "2>&1" , exit_status : 1 ) . lines
23
23
lines . map! { |l | l . chomp [ /:(in.+)/ , 1 ] }
24
- lines . size . should == 5
25
- lines [ 0 ] . should =~ /\A in [`'](?:Object#)?raise_wrapped': wrapped \( RuntimeError\) \z /
26
- lines [ 1 ] . should =~ /\A in [`'](?:rescue in )?<main>'\z /
27
- lines [ 2 ] . should =~ /\A in [`']<main>'\z /
28
- lines [ 3 ] . should =~ /\A in [`'](?:Object#)?raise_cause': the cause \( RuntimeError\) \z /
29
- lines [ 4 ] . should =~ /\A in [`']<main>'\z /
24
+ expected = [
25
+ /\A in [`'](?:Object#)?raise_wrapped': wrapped \( RuntimeError\) \z / ,
26
+ # https://bugs.ruby-lang.org/issues/20275
27
+ *( /\A in [`'](?:rescue in )?<main>'\z / if RUBY_ENGINE == 'ruby' ) ,
28
+ /\A in [`']<main>'\z / ,
29
+ /\A in [`'](?:Object#)?raise_cause': the cause \( RuntimeError\) \z / ,
30
+ /\A in [`']<main>'\z / ,
31
+ ]
32
+ lines . size . should == expected . size
33
+ lines . zip ( expected ) { |l , e | l . should =~ e }
30
34
end
31
35
32
36
describe "with a custom backtrace" do
You can’t perform that action at this time.
0 commit comments