[前][次][番号順一覧][スレッド一覧]

ruby-changes:19527

From: kosaki <ko1@a...>
Date: Sat, 14 May 2011 19:53:35 +0900 (JST)
Subject: [ruby-changes:19527] kosaki:r31567 (trunk): * test/ruby/test_rubyoptions.rb (TestRubyOptions#test_set_program_name):

kosaki	2011-05-14 19:53:29 +0900 (Sat, 14 May 2011)

  New Revision: 31567

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=31567

  Log:
    * test/ruby/test_rubyoptions.rb (TestRubyOptions#test_set_program_name):
    add for $0 test.

  Modified files:
    trunk/ChangeLog
    trunk/test/ruby/test_rubyoptions.rb

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 31566)
+++ ChangeLog	(revision 31567)
@@ -1,3 +1,8 @@
+Sat May 14 19:52:22 2011  KOSAKI Motohiro  <kosaki.motohiro@g...>
+
+	* test/ruby/test_rubyoptions.rb (TestRubyOptions#test_set_program_name):
+	add for $0 test.
+
 Sat May 14 19:50:46 2011  KOSAKI Motohiro  <kosaki.motohiro@g...>
 
 	* missing/setproctitle.c (compat_init_setproctitle): use
Index: test/ruby/test_rubyoptions.rb
===================================================================
--- test/ruby/test_rubyoptions.rb	(revision 31566)
+++ test/ruby/test_rubyoptions.rb	(revision 31567)
@@ -400,6 +400,14 @@
     }
   end
 
+  def test_set_program_name
+    skip if /linux|freebsd|netbsd|openbsd/ !~ RUBY_PLATFORM
+
+    $0 = 'hello world'
+    ps = `ps -p #{$$} -o cmd`
+    assert_match(/hello world/, ps)
+  end
+
   def test_segv_test
     opts = {}
     if /mswin|mingw/ =~ RUBY_PLATFORM

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]