public
Created

Platform sniffing...grrrr

  • Download Gist
step_invocation.rb
Ruby
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
class Cucumber::Ast::StepInvocation
def failed(configuration, e, clear_backtrace)
if Cucumber::JRUBY && e.class.name == 'NativeException'
# JRuby's NativeException ignores #set_backtrace.
# We're fixing it.
e.instance_eval do
def set_backtrace(backtrace)
@backtrace = backtrace
end
 
def backtrace
@backtrace
end
end
end
 
e.set_backtrace([]) if e.backtrace.nil? || clear_backtrace
e.backtrace << @step.backtrace_line unless @step.backtrace_line.nil?
e = filter_backtrace(e)
@exception = e
if(configuration.strict? || !(Undefined === e) || e.nested?)
@reported_exception = e
else
@reported_exception = nil
end
end
end

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.