ruby-changes:10545
From: nobu <ko1@a...>
Date: Sat, 7 Feb 2009 00:26:42 +0900 (JST)
Subject: [ruby-changes:10545] Ruby:r22100 (trunk): * test/etc/test_etc.rb: trivial.
nobu 2009-02-07 00:26:36 +0900 (Sat, 07 Feb 2009) New Revision: 22100 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=22100 Log: * test/etc/test_etc.rb: trivial. Modified files: trunk/test/etc/test_etc.rb trunk/version.h Index: version.h =================================================================== --- version.h (revision 22099) +++ version.h (revision 22100) @@ -1,5 +1,5 @@ #define RUBY_VERSION "1.9.2" -#define RUBY_RELEASE_DATE "2009-02-06" +#define RUBY_RELEASE_DATE "2009-02-07" #define RUBY_PATCHLEVEL -1 #define RUBY_BRANCH_NAME "trunk" @@ -8,7 +8,7 @@ #define RUBY_VERSION_TEENY 1 #define RUBY_RELEASE_YEAR 2009 #define RUBY_RELEASE_MONTH 2 -#define RUBY_RELEASE_DAY 6 +#define RUBY_RELEASE_DAY 7 #ifdef RUBY_EXTERN RUBY_EXTERN const char ruby_version[]; Index: test/etc/test_etc.rb =================================================================== --- test/etc/test_etc.rb (revision 22099) +++ test/etc/test_etc.rb (revision 22100) @@ -29,8 +29,8 @@ def test_getpwuid passwd = {} - Etc.passwd {|s| passwd[s.uid] = s unless passwd[s.uid] } - passwd.values.each do |s| + Etc.passwd {|s| passwd[s.uid] ||= s } + passwd.each_value do |s| assert_equal(s, Etc.getpwuid(s.uid)) assert_equal(s, Etc.getpwuid) if Process.euid == s.uid end @@ -38,8 +38,8 @@ def test_getpwnam passwd = {} - Etc.passwd {|s| passwd[s.name] = s unless passwd[s.name] } - passwd.values.each do |s| + Etc.passwd {|s| passwd[s.name] ||= s } + passwd.each_value do |s| assert_equal(s, Etc.getpwnam(s.name)) end end @@ -69,11 +69,9 @@ def test_getgrgid groups = {} Etc.group do |s| - unless groups[s.gid] - groups[s.gid] = s - end + groups[s.gid] ||= s end - groups.values.each do |s| + groups.each_value do |s| assert_equal(s, Etc.getgrgid(s.gid)) assert_equal(s, Etc.getgrgid) if Process.egid == s.gid end @@ -82,11 +80,9 @@ def test_getgrnam groups = {} Etc.group do |s| - unless groups[s.name] - groups[s.name] = s - end + groups[s.name] ||= s end - groups.values.each do |s| + groups.each_value do |s| assert_equal(s, Etc.getgrnam(s.name)) end end -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/