summaryrefslogtreecommitdiff
path: root/spec/support/profiler.rb
blob: 51da8fbdf954edf95bf6f51c1d871a48ee67f228 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
# frozen_string_literal: true

require 'ruby-prof'

RSpec.configure do |config|
  config.include(Module.new do
    def with_profiler(*_args)
      RubyProf::GraphPrinter
        .new(RubyProf.profile { yield })
        .print($stdout, {})
    end
  end)
end