* test/ruby/test_system.rb (TestSystem#test_system_at):
added test. [ruby-core:35218] (#4393) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30869 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
cee21ad215
commit
8068d73cc1
@ -91,7 +91,20 @@ class TestSystem < Test::Unit::TestCase
|
|||||||
def test_system_at
|
def test_system_at
|
||||||
if /mswin|mingw/ =~ RUBY_PLATFORM
|
if /mswin|mingw/ =~ RUBY_PLATFORM
|
||||||
testname = '[ruby-core:35218]'
|
testname = '[ruby-core:35218]'
|
||||||
|
|
||||||
|
# @ + builtin command
|
||||||
assert_equal("foo\n", `@echo foo`, testname);
|
assert_equal("foo\n", `@echo foo`, testname);
|
||||||
|
assert_equal("foo\n", `@@echo foo`, testname);
|
||||||
|
|
||||||
|
# @ + non builtin command
|
||||||
|
Dir.mktmpdir("ruby_script_tmp") {|tmpdir|
|
||||||
|
tmpfilename = "#{tmpdir}/ruby_script_tmp.#{$$}"
|
||||||
|
|
||||||
|
tmp = open(tmpfilename, "w")
|
||||||
|
tmp.print "foo\nbar\nbaz";
|
||||||
|
tmp.close
|
||||||
|
assert_match(/\n.*\nbar\nbaz\n/, `@@find "ba" #{tmpfilename.gsub("/", "\\")}`, testname);
|
||||||
|
}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user