* test/ruby/test_system.rb (TestSystem#test_system_redirect_win):

add test for system().



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30969 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
kosaki 2011-02-27 13:03:01 +00:00
parent c6598ffcae
commit f0f7079d48
2 changed files with 17 additions and 0 deletions

View File

@ -1,3 +1,8 @@
Sun Feb 27 21:59:37 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
* test/ruby/test_system.rb (TestSystem#test_system_redirect_win):
add test for system().
Sun Feb 27 18:00:09 2011 Shota Fukumori <sorah@tubusu.net> Sun Feb 27 18:00:09 2011 Shota Fukumori <sorah@tubusu.net>
* lib/test/unit.rb: Refactoring; Worker never use Hash for internal * lib/test/unit.rb: Refactoring; Worker never use Hash for internal

View File

@ -126,6 +126,18 @@ class TestSystem < Test::Unit::TestCase
end end
end end
def test_system_redirect_win
if /mswin|mingw/ !~ RUBY_PLATFORM
return
end
cmd = "%WINDIR%/system32/ping.exe \"BFI3CHL671\" > out.txt 2>NUL"
assert_equal(false, system(cmd), '[ruby-talk:258939]');
cmd = "\"%WINDIR%/system32/ping.exe BFI3CHL671\" > out.txt 2>NUL"
assert_equal(false, system(cmd), '[ruby-talk:258939]');
end
def test_empty_evstr def test_empty_evstr
assert_equal("", eval('"#{}"', nil, __FILE__, __LINE__), "[ruby-dev:25113]") assert_equal("", eval('"#{}"', nil, __FILE__, __LINE__), "[ruby-dev:25113]")
end end