diff options
Diffstat (limited to 'test/test_posix_mq.rb')
-rw-r--r-- | test/test_posix_mq.rb | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/test/test_posix_mq.rb b/test/test_posix_mq.rb index 00b0f5a..dccc547 100644 --- a/test/test_posix_mq.rb +++ b/test/test_posix_mq.rb @@ -136,11 +136,27 @@ class Test_POSIX_MQ < Test::Unit::TestCase assert_nil(@mq.notify = nil) assert_nothing_raised { @mq.send("hello", 0) } assert_nil IO.select([rd], nil, nil, 0.1) - assert_raises(Errno::EBUSY) { @mq.notify = :USR1 } ensure trap(:USR1, orig) end + def test_notify_none + @mq = POSIX_MQ.new @path, IO::CREAT|IO::RDWR, 0666 + assert_nothing_raised { @mq.notify = false } + pid = fork do + begin + @mq.notify = :USR1 + rescue Errno::EBUSY + exit 0 + rescue => e + p e + end + exit! 1 + end + _, status = Process.waitpid2(pid) + assert status.success?, status.inspect + end + def test_setattr @mq = POSIX_MQ.new @path, IO::CREAT|IO::WRONLY, 0666 mq_attr = POSIX_MQ::Attr.new(IO::NONBLOCK) |