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

describe "TracePoint#callee_id" do
  it "returns the called name of the method being called" do
    a = []
    obj = TracePointSpec::ClassWithMethodAlias.new

    TracePoint.new(:call) do |tp|
      next unless TracePointSpec.target_thread?
      a << tp.callee_id
    end.enable do
      obj.m_alias
    end

    a.should == [:m_alias]
  end
end