From 8068d73cc11957c37a6869d4e0325191f7a9a040 Mon Sep 17 00:00:00 2001 From: kosaki Date: Mon, 14 Feb 2011 08:49:55 +0000 Subject: * 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 --- test/ruby/test_system.rb | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'test/ruby/test_system.rb') diff --git a/test/ruby/test_system.rb b/test/ruby/test_system.rb index 7f5b81a2de..faf63deba3 100644 --- a/test/ruby/test_system.rb +++ b/test/ruby/test_system.rb @@ -91,7 +91,20 @@ class TestSystem < Test::Unit::TestCase def test_system_at if /mswin|mingw/ =~ RUBY_PLATFORM testname = '[ruby-core:35218]' + + # @ + builtin command 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 -- cgit v1.2.3