Module: TestProf::RubyProf::RSpecExclusions

Defined in:
lib/test_prof/ruby_prof/rspec_exclusions.rb

Overview

Generates the list of RSpec (framework internal) methods to exclude from profiling

Class Method Summary collapse

Class Method Details

.generateObject



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
# File 'lib/test_prof/ruby_prof/rspec_exclusions.rb', line 10

def generate
  {
    RSpec::Core::Runner => %i[
      run
      run_specs
    ],

    RSpec::Core::ExampleGroup => %i[
      run
      run_examples
    ],

    RSpec::Core::ExampleGroup.singleton_class => %i[
      run
      run_examples
    ],

    RSpec::Core::Example => %i[
      run
      with_around_and_singleton_context_hooks
      with_around_example_hooks
      instance_exec
      run_before_example
    ],

    RSpec::Core::Example.singleton_class => %i[
      run
      with_around_and_singleton_context_hooks
      with_around_example_hooks
    ],

    RSpec::Core::Example::Procsy => [
      :call
    ],

    RSpec::Core::Hooks::HookCollections => %i[
      run
      run_around_example_hooks_for
      run_example_hooks_for
      run_owned_hooks_for
    ],

    RSpec::Core::Hooks::BeforeHook => [
      :run
    ],

    RSpec::Core::Hooks::AroundHook => [
      :execute_with
    ],

    RSpec::Core::Configuration => [
      :with_suite_hooks
    ],

    RSpec::Core::Reporter => [
      :report
    ]
  }.tap do |data|
    if defined?(RSpec::Support::ReentrantMutex)
      data[RSpec::Support::ReentrantMutex] = [
        :synchronize
      ]
    end

    if defined?(RSpec::Core::MemoizedHelpers::ThreadsafeMemoized)
      data.merge!(
        RSpec::Core::MemoizedHelpers::ThreadsafeMemoized => [
          :fetch_or_store
        ],

        RSpec::Core::MemoizedHelpers::NonThreadSafeMemoized => [
          :fetch_or_store
        ],

        RSpec::Core::MemoizedHelpers::ContextHookMemoized => [
          :fetch_or_store
        ]
      )
    end
  end
end