summaryrefslogtreecommitdiff
path: root/spec/ruby/core/tracepoint/method_id_spec.rb
blob: 43e23248b7ee2c03a79d843c483f547a5e28447a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
require_relative '../../spec_helper'
require_relative 'fixtures/classes'

describe 'TracePoint#method_id' do
  it 'returns the name at the definition of the method being called' do
    method_name = nil
    TracePoint.new(:call) { |tp|
      next unless TracePointSpec.target_thread?
      method_name = tp.method_id
    }.enable do
      TracePointSpec.test
      method_name.should equal(:test)
    end
  end
end