summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorPeter Zhu <peter@peterzhu.ca>2023-11-28 12:22:46 -0500
committerPeter Zhu <peter@peterzhu.ca>2023-11-28 12:22:46 -0500
commitfadd28c7ba6b55ec934f379cfc30a8111e340404 (patch)
tree7168bfe5e6c102f6d32853e7b2e72e9ce263d9c4 /lib
parent476a231e7e2c2a370ea9f47c9b62e8d6d3d9442d (diff)
[ruby/irb] Change show_source tests into integration tests
* Remove trailing spaces * Migrate show_source tests to integration tests Because show_source tests often need to define class and/or methods, they can easily leak state to other tests. Changing them to integration tests will ensure that they are run in a clean environment. * Fix NoMethodError caused by SourceFinder#method_target https://github.com/ruby/irb/commit/3c39f13397c72a8db24e50afdcb8942e6c4ea12f
Diffstat (limited to 'lib')
-rw-r--r--lib/irb/source_finder.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/irb/source_finder.rb b/lib/irb/source_finder.rb
index a9450d4571..a0aedcee68 100644
--- a/lib/irb/source_finder.rb
+++ b/lib/irb/source_finder.rb
@@ -77,6 +77,8 @@ module IRB
target_method = target_method.super_method if target_method
end
target_method.nil? ? nil : target_method.source_location
+ rescue NameError
+ nil
end
end
end