summaryrefslogtreecommitdiff
path: root/test/ruby/test_system.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-08-05 10:19:18 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-08-05 10:19:18 +0000
commit8bc6c715475aae33d292b077003d15ea47b9913f (patch)
treea1f0a4816ac2d9ae47091ef743ba2acf4b9d14d1 /test/ruby/test_system.rb
parentcb9038cbafd42efd669524417ee73919bed58c49 (diff)
* ruby.c (load_file_internal): assumes -x flag if no "ruby" is in
the shebang line. [ruby-dev:39015] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24410 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_system.rb')
-rw-r--r--test/ruby/test_system.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/ruby/test_system.rb b/test/ruby/test_system.rb
index 903918812d..0fbad0af33 100644
--- a/test/ruby/test_system.rb
+++ b/test/ruby/test_system.rb
@@ -46,6 +46,18 @@ class TestSystem < Test::Unit::TestCase
assert_equal('555', `#{ruby} -x #{tmpfilename} -zzz=555`)
tmp = open(tmpfilename, "w")
+ tmp.print "#! /non/exist\\interpreter?/./to|be:ignored\n";
+ tmp.print "this is a leading junk\n";
+ tmp.print "#! /usr/local/bin/ruby -s\n";
+ tmp.print "print $zzz\n";
+ tmp.print "__END__\n";
+ tmp.print "this is a trailing junk\n";
+ tmp.close
+
+ assert_equal('', `#{ruby} #{tmpfilename}`)
+ assert_equal('555', `#{ruby} #{tmpfilename} -zzz=555`)
+
+ tmp = open(tmpfilename, "w")
for i in 1..5
tmp.print i, "\n"
end