Skip to content

Commit

Permalink
Skip backtrace related tests when backtrace isn't available
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Dec 29, 2015
1 parent a561bdb commit 0ebac02
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test/t/exception.rb
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,17 @@ def z
end
end

def backtrace_avaialble?
begin
raise "XXX"
rescue => exception
not exception.backtrace.empty?
end
end

assert('GC in rescue') do
skip "backtrace isn't avaialble" unless backtrace_avaialble?

line = nil
begin
[1].each do
Expand All @@ -391,6 +401,8 @@ def z
end

assert('Method call in rescue') do
skip "backtrace isn't avaialble" unless backtrace_avaialble?

line = nil
begin
[1].each do
Expand Down

0 comments on commit 0ebac02

Please sign in to comment.