mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Test for r60396
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60400 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
1333c0f0df
commit
177856b8a7
1 changed files with 15 additions and 0 deletions
|
@ -346,6 +346,21 @@ class TestRubyOptions < Test::Unit::TestCase
|
||||||
assert_ruby_status(%w[], "#! ruby -- /", '[ruby-core:82267] [Bug #13786]')
|
assert_ruby_status(%w[], "#! ruby -- /", '[ruby-core:82267] [Bug #13786]')
|
||||||
end
|
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
|
def test_sflag
|
||||||
assert_in_out_err(%w(- -abc -def=foo -ghi-jkl -- -xyz),
|
assert_in_out_err(%w(- -abc -def=foo -ghi-jkl -- -xyz),
|
||||||
"#!ruby -s\np [$abc, $def, $ghi_jkl, defined?($xyz)]\n",
|
"#!ruby -s\np [$abc, $def, $ghi_jkl, defined?($xyz)]\n",
|
||||||
|
|
Loading…
Reference in a new issue