summaryrefslogtreecommitdiff
path: root/spec/ruby/core/exception
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/core/exception')
-rw-r--r--spec/ruby/core/exception/backtrace_spec.rb2
-rw-r--r--spec/ruby/core/exception/top_level_spec.rb12
2 files changed, 7 insertions, 7 deletions
diff --git a/spec/ruby/core/exception/backtrace_spec.rb b/spec/ruby/core/exception/backtrace_spec.rb
index bce6c95175..9a65ea3820 100644
--- a/spec/ruby/core/exception/backtrace_spec.rb
+++ b/spec/ruby/core/exception/backtrace_spec.rb
@@ -27,7 +27,7 @@ describe "Exception#backtrace" do
end
it "includes the name of the method from where self raised in the first element" do
- @backtrace.first.should =~ /in [`']backtrace'/
+ @backtrace.first.should =~ /in [`'](?:ExceptionSpecs::Backtrace\.)?backtrace'/
end
it "includes the filename of the location immediately prior to where self raised in the second element" do
diff --git a/spec/ruby/core/exception/top_level_spec.rb b/spec/ruby/core/exception/top_level_spec.rb
index 8a1e3b92f9..6ef7539598 100644
--- a/spec/ruby/core/exception/top_level_spec.rb
+++ b/spec/ruby/core/exception/top_level_spec.rb
@@ -20,13 +20,13 @@ describe "An Exception reaching the top level" do
end
RUBY
lines = ruby_exe(code, args: "2>&1", exit_status: 1).lines
- lines.reject! { |l| l.include?('rescue in') }
lines.map! { |l| l.chomp[/:(in.+)/, 1] }
- lines.size.should == 4
- lines[0].should =~ /\Ain [`']raise_wrapped': wrapped \(RuntimeError\)\z/
- lines[1].should =~ /\Ain [`']<main>'\z/
- lines[2].should =~ /\Ain [`']raise_cause': the cause \(RuntimeError\)\z/
- lines[3].should =~ /\Ain [`']<main>'\z/
+ lines.size.should == 5
+ lines[0].should =~ /\Ain [`'](?:Object#)?raise_wrapped': wrapped \(RuntimeError\)\z/
+ lines[1].should =~ /\Ain [`'](?:rescue in )?<main>'\z/
+ lines[2].should =~ /\Ain [`']<main>'\z/
+ lines[3].should =~ /\Ain [`'](?:Object#)?raise_cause': the cause \(RuntimeError\)\z/
+ lines[4].should =~ /\Ain [`']<main>'\z/
end
describe "with a custom backtrace" do