diff options
Diffstat (limited to 'test/optparse/test_optparse.rb')
| -rw-r--r-- | test/optparse/test_optparse.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/optparse/test_optparse.rb b/test/optparse/test_optparse.rb index d50203bb63..ff334009a6 100644 --- a/test/optparse/test_optparse.rb +++ b/test/optparse/test_optparse.rb @@ -216,4 +216,16 @@ class TestOptionParser < Test::Unit::TestCase end end end + + def test_program_name + program = $0 + $0 = "rdbg3.5" + assert_equal "rdbg3.5", OptionParser.new.program_name + RbConfig::CONFIG["EXECUTABLE_EXTS"]&.split(" ") do |ext| + $0 = "rdbg3.5" + ext + assert_equal "rdbg3.5", OptionParser.new.program_name + end + ensure + $0 = program + end end |
