From 1819652578e8f9fe3606f7a716ec4e427fc55f0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nguy=E1=BB=85n=20Quang=20Minh?= Date: Thu, 6 Aug 2020 09:56:24 +0700 Subject: [Feature #16513] TracePoint#inspect returns "... file:line" (#3391) * Fix debug documents to match Thread#to_s change (Feature #16412 ticket) * TracePoint#inspect returns "... file:line" (Feature #16513) * Guard older version of Ruby in Tracepoint inspection tests * Focus on current thread only when running TracePoint inspection test --- spec/ruby/core/tracepoint/enable_spec.rb | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'spec/ruby/core/tracepoint/enable_spec.rb') diff --git a/spec/ruby/core/tracepoint/enable_spec.rb b/spec/ruby/core/tracepoint/enable_spec.rb index aa0c3aa0dc..13c7b82b54 100644 --- a/spec/ruby/core/tracepoint/enable_spec.rb +++ b/spec/ruby/core/tracepoint/enable_spec.rb @@ -123,6 +123,18 @@ describe 'TracePoint#enable' do end describe "when nested" do + before do + ruby_version_is ""..."2.8" do + # Old behavior for Ruby < 2.8 + @path_prefix = '@' + end + + ruby_version_is "2.8" do + # New behavior for Ruby >= 2.8 + @path_prefix = ' ' + end + end + it "enables both TracePoints but only calls the respective callbacks" do called = false first = TracePoint.new(:line) do |tp| @@ -146,7 +158,7 @@ describe 'TracePoint#enable' do end all.uniq.should == [second] - inspects.uniq.should == ["#"] + inspects.uniq.should == ["#"] called.should == true end end -- cgit v1.2.3