[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

3c39f13397
This commit is contained in:
Peter Zhu 2023-11-28 12:22:46 -05:00
parent 476a231e7e
commit fadd28c7ba
3 changed files with 265 additions and 228 deletions

View file

@ -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