From 8bc6c715475aae33d292b077003d15ea47b9913f Mon Sep 17 00:00:00 2001 From: nobu Date: Wed, 5 Aug 2009 10:19:18 +0000 Subject: * 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 --- test/ruby/test_system.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'test') 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 @@ -45,6 +45,18 @@ class TestSystem < Test::Unit::TestCase assert_equal('', `#{ruby} -x #{tmpfilename}`) 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" -- cgit v1.2.3