Project

General

Profile

Actions

Bug #16399

closed

TracePoint.stat disappeared in Ruby-2.7.0-preview3

Added by TOKI.Yoshinori (仁謙 土岐) almost 5 years ago. Updated almost 5 years ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 2.7.0preview3 (2019-11-23 master b563439274) [x86_64-linux]
[ruby-core:96103]

Description

TracePoint.stat method that existed in Ruby 2.6 (including 2.7.0-preview2) no longer exists in Ruby 2.7.0-preview3, but instead, TracePoint#stat method that did not exist so far has been added.

Test Script:

#!/usr/bin/env ruby

require 'test/unit'

class TracePointTest < Test::Unit::TestCase
  test 'TracePoint.stat' do
    assert_respond_to(TracePoint, :stat)
  end

  test 'no TracePoint#stat' do
    assert_not_respond_to(TracePoint.new{}, :stat)
  end
end

Output (Ruby 2.7.0-preview3):

$ ruby -v
ruby 2.7.0preview3 (2019-11-23 master b563439274) [x86_64-linux]
$ ruby test_tracepoint_stat.rb -v
Loaded suite test_tracepoint_stat
Started
TracePointTest:
  test: TracePoint.stat:                                                                                                        F
======================================================================================================================================================
      4:
      5: class TracePointTest < Test::Unit::TestCase
      6:   test 'TracePoint.stat' do
  =>  7:     assert_respond_to(TracePoint, :stat)
      8:   end
      9:
     10:   test 'no TracePoint#stat' do
test_tracepoint_stat.rb:7:in `block in <class:TracePointTest>'
Failure: test: TracePoint.stat(TracePointTest):
  <TracePoint>.respond_to?(:stat) expected
  (Class: <Class>)
======================================================================================================================================================
: (0.005388)
  test: no TracePoint#stat:                                                                                                     F
======================================================================================================================================================
      8:   end
      9:
     10:   test 'no TracePoint#stat' do
  => 11:     assert_not_respond_to(TracePoint.new{}, :stat)
     12:   end
     13: end
test_tracepoint_stat.rb:11:in `block in <class:TracePointTest>'
Failure: test: no TracePoint#stat(TracePointTest):
  !<#<TracePoint:disabled>>.respond_to?(:stat) expected
  (Class: <TracePoint>)
======================================================================================================================================================
: (0.000824)

Finished in 0.006592796 seconds.
------------------------------------------------------------------------------------------------------------------------------------------------------
2 tests, 2 assertions, 2 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications
0% passed
------------------------------------------------------------------------------------------------------------------------------------------------------
303.36 tests/s, 303.36 assertions/s

Expected Output (Ruby 2.6.4):

$ ruby -v
ruby 2.6.5p114 (2019-10-01 revision 67812) [x86_64-linux]
$ ruby test_tracepoint_stat.rb -v
Loaded suite test_tracepoint_stat
Started
TracePointTest:
  test: TracePoint.stat:                                                                                                        .: (0.000265)
  test: no TracePoint#stat:                                                                                                     .: (0.000046)

Finished in 0.0006746 seconds.
------------------------------------------------------------------------------------------------------------------------------------------------------
2 tests, 2 assertions, 0 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications
100% passed
------------------------------------------------------------------------------------------------------------------------------------------------------
2964.72 tests/s, 2964.72 assertions/s
Actions

Also available in: Atom PDF

Like0
Like0Like0