module Busted::Traceable

Attributes

report[W]
trace[R]
tracer[R]

Public Instance Methods

finish_tracer() click to toggle source
# File lib/busted/traceable.rb, line 29
def finish_tracer
  return unless trace?

  tracer.finish

  report[:traces] = tracer.report
end
start_tracer() click to toggle source
# File lib/busted/traceable.rb, line 13
def start_tracer
  return unless trace?

  unless Tracer.exists?
    fail Tracer::MissingCommandError, "tracer requires dtrace"
  end

  unless CurrentProcess.privileged?
    fail Errno::EPERM, "dtrace requires root privileges"
  end

  @tracer = Tracer.new

  tracer.start
end
trace?() click to toggle source
# File lib/busted/traceable.rb, line 9
def trace?
  trace
end