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

ruby_version_is '2.4' do
  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|
        a << tp.callee_id
      end.enable do
        obj.m_alias
      end

      a.should == [:m_alias]
    end
  end
end