aboutsummaryrefslogtreecommitdiffstats
path: root/spec/ruby/core/tracepoint/path_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/ruby/core/tracepoint/path_spec.rb')
-rw-r--r--spec/ruby/core/tracepoint/path_spec.rb16
1 files changed, 12 insertions, 4 deletions
diff --git a/spec/ruby/core/tracepoint/path_spec.rb b/spec/ruby/core/tracepoint/path_spec.rb
index 1e31c1bb68..5b6c6d4cfc 100644
--- a/spec/ruby/core/tracepoint/path_spec.rb
+++ b/spec/ruby/core/tracepoint/path_spec.rb
@@ -1,18 +1,26 @@
require_relative '../../spec_helper'
+require_relative 'fixtures/classes'
describe 'TracePoint#path' do
it 'returns the path of the file being run' do
path = nil
- TracePoint.new(:line) { |tp| path = tp.path }.enable do
- path.should == "#{__FILE__}"
+ TracePoint.new(:line) { |tp|
+ next unless TracePointSpec.target_thread?
+ path = tp.path
+ }.enable do
+ line_event = true
end
+ path.should == "#{__FILE__}"
end
it 'equals (eval) inside an eval for :end event' do
path = nil
- TracePoint.new(:end) { |tp| path = tp.path }.enable do
+ TracePoint.new(:end) { |tp|
+ next unless TracePointSpec.target_thread?
+ path = tp.path
+ }.enable do
eval("module TracePointSpec; end")
- path.should == '(eval)'
end
+ path.should == '(eval)'
end
end