diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-10-24 11:24:19 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-10-24 11:24:19 +0000 |
commit | 177856b8a73269366508194066e119305548535e (patch) | |
tree | ced50cade880575e2a8c261ecdfe71b069a6202b /test | |
parent | 1333c0f0df4a82fd128425e273f03cd689138917 (diff) | |
download | ruby-177856b8a73269366508194066e119305548535e.tar.gz |
Test for r60396
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60400 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_rubyoptions.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/test/ruby/test_rubyoptions.rb b/test/ruby/test_rubyoptions.rb index 27969690d8..8cb74edb32 100644 --- a/test/ruby/test_rubyoptions.rb +++ b/test/ruby/test_rubyoptions.rb @@ -346,6 +346,21 @@ class TestRubyOptions < Test::Unit::TestCase assert_ruby_status(%w[], "#! ruby -- /", '[ruby-core:82267] [Bug #13786]') end + def test_flag_in_shebang + Tempfile.create(%w"pflag .rb") do |script| + code = "#!ruby -p" + script.puts(code) + script.close + assert_in_out_err([script.path, script.path], '', [code]) + end + Tempfile.create(%w"sflag .rb") do |script| + script.puts("#!ruby -s") + script.puts("p $abc") + script.close + assert_in_out_err([script.path, "-abc=foo"], '', ['"foo"']) + end + end + def test_sflag assert_in_out_err(%w(- -abc -def=foo -ghi-jkl -- -xyz), "#!ruby -s\np [$abc, $def, $ghi_jkl, defined?($xyz)]\n", |