summaryrefslogtreecommitdiff
path: root/spec/support/profiler.rb
blob: 3b8b36be7950371d026a94c6f68918e2f0833ae6 (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