From ef92c2a16e77a7a2cd107d7ee72e72942e13e0a1 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: http://svn.ruby-lang.org/repos/ruby/trunk@24410 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_system.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'test/ruby') diff --git a/test/ruby/test_system.rb b/test/ruby/test_system.rb index 903918812..0fbad0af3 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