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

ruby-changes:18682

From: kosaki <ko1@a...>
Date: Fri, 28 Jan 2011 17:50:25 +0900 (JST)
Subject: [ruby-changes:18682] Ruby:r30707 (trunk): * test/gdbm/test_gdbm.rb (TestGDBM2#test_writer_open_notexist):

kosaki	2011-01-28 17:50:18 +0900 (Fri, 28 Jan 2011)

  New Revision: 30707

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

  Log:
    * test/gdbm/test_gdbm.rb (TestGDBM2#test_writer_open_notexist):
      gdbm 1.8.x changed GDBM::WRITER behavior. Thus our testcase need
      to be changed too.

  Modified files:
    trunk/ChangeLog
    trunk/test/gdbm/test_gdbm.rb

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 30706)
+++ ChangeLog	(revision 30707)
@@ -1,3 +1,9 @@
+Fri Jan 28 17:47:33 2011  KOSAKI Motohiro  <kosaki.motohiro@g...>
+
+	* test/gdbm/test_gdbm.rb (TestGDBM2#test_writer_open_notexist):
+	  gdbm 1.8.x changed GDBM::WRITER behavior. Thus our testcase need
+	  to be changed too.
+
 Fri Jan 28 17:33:28 2011  KOSAKI Motohiro  <kosaki.motohiro@g...>
 
 	* test/gdbm/test_gdbm.rb (TestGDBM#test_s_open_no_create): skip
Index: test/gdbm/test_gdbm.rb
===================================================================
--- test/gdbm/test_gdbm.rb	(revision 30706)
+++ test/gdbm/test_gdbm.rb	(revision 30707)
@@ -667,9 +667,18 @@
     end
 
     def test_writer_open_notexist
-      assert_raise(Errno::ENOENT) {
-        GDBM.open("#{@tmproot}/a", 0666, GDBM::WRITER)
-      }
+      if /1\.8\./ =~ GDBM::VERSION
+        # 1.8.x are using O_RDWR|O_CREAT.
+        assert_nothing_raised {
+          GDBM.open("#{@tmproot}/a", 0666, GDBM::WRITER)
+        }
+      else
+        # 1.7.x are using O_RDWR.
+        assert_raise(Errno::ENOENT) {
+          GDBM.open("#{@tmproot}/a", 0666, GDBM::WRITER)
+        }
+      end
+
     end
 
     def test_wrcreat_open_notexist

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

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