Create a gist now

Instantly share code, notes, and snippets.

Platform sniffing...grrrr
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment