test/mqueue_test.rb in posix-mqueue-0.0.3 vs test/mqueue_test.rb in posix-mqueue-0.0.4
- old
+ new
@@ -43,13 +43,25 @@
assert_equal "hello", @queue.receive
other.unlink
end
- # def test_send_raises_exception_instead_of_blocking
- # 10.times { @queue.send "walrus" }
+ def test_timedsend_raises_exception_instead_of_blocking
+ 10.times { @queue.timedsend 0, 0, "walrus" }
- # assert_raises Exception do
- # @queue.send "hi"
- # end
- # end
+ assert_raises POSIX::Mqueue::QueueFull do
+ @queue.timedsend(0, 0, "hi")
+ end
+ end
+
+ def test_timedreceive_raises_exception_instead_of_blocking
+ assert_raises POSIX::Mqueue::QueueEmpty do
+ @queue.timedreceive(0, 0)
+ end
+ end
+
+ def test_errors_when_queue_name_is_not_slash_prefixed
+ assert_raises Errno::EINVAL do
+ POSIX::Mqueue.new("notvalid")
+ end
+ end
end