diff options
author | kosaki <kosaki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-01-28 08:50:18 +0000 |
---|---|---|
committer | kosaki <kosaki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-01-28 08:50:18 +0000 |
commit | 3a0ec6810909b8da01427bc1f38c02f4e370807e (patch) | |
tree | eb6eb4f28de787f6ad37e92250b5c117a7f82a27 | |
parent | 36f71db31eca74cfc3f978b820c96af895211851 (diff) | |
download | ruby-3a0ec6810909b8da01427bc1f38c02f4e370807e.tar.gz |
* 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.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30707 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | test/gdbm/test_gdbm.rb | 15 |
2 files changed, 18 insertions, 3 deletions
@@ -1,3 +1,9 @@ +Fri Jan 28 17:47:33 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com> + + * 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@gmail.com> * test/gdbm/test_gdbm.rb (TestGDBM#test_s_open_no_create): skip diff --git a/test/gdbm/test_gdbm.rb b/test/gdbm/test_gdbm.rb index 117c73f713..f98152a302 100644 --- a/test/gdbm/test_gdbm.rb +++ b/test/gdbm/test_gdbm.rb @@ -667,9 +667,18 @@ if defined? GDBM 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 |