diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/gdbm/test_gdbm.rb | 15 |
1 files changed, 12 insertions, 3 deletions
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 |