summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMarc-Andre Lafortune <github@marc-andre.ca>2021-03-18 09:44:42 -0400
committeraycabta <aycabta@gmail.com>2021-09-10 06:37:06 +0900
commit3503c94af501e38164613ef8347174a27346828a (patch)
tree33858da830276928921ea52e78bb1679413f32bd /test
parent192147afd875a177b45086d904bd910a3dc8ff7e (diff)
[ruby/irb] Avoid loading files' local variables [Bug #17623]
https://github.com/ruby/irb/commit/b12f0cb8e2
Diffstat (limited to 'test')
-rw-r--r--test/irb/test_workspace.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/irb/test_workspace.rb b/test/irb/test_workspace.rb
index a39bea2050..61653486a1 100644
--- a/test/irb/test_workspace.rb
+++ b/test/irb/test_workspace.rb
@@ -80,6 +80,16 @@ module TestIRB
assert_equal(nil, workspace.code_around_binding)
end
+
+ def test_toplevel_binding_local_variables
+ bug17623 = '[ruby-core:102468]'
+ bundle_exec = ENV.key?('BUNDLE_GEMFILE') ? ['-rbundler/setup'] : []
+ status = assert_in_out_err(bundle_exec + ['-W0', '-e', <<~RUBY , '--', '-f', '--'], 'binding.local_variables', /\[:_\]/, [], bug17623)
+ version = 'xyz' # typical rubygems loading file
+ load('./exe/irb')
+ RUBY
+ end
+
private
def with_script_lines