1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* lib/thread.rb (Queue#push): return self.

* lib/thread.rb (Queue#clear): ditto.
* lib/thread.rb (SizedQueue#push): ditto.
* test/thread/test_queue.rb: add tests for the above.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39713 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
kosaki 2013-03-10 23:01:21 +00:00
parent 0b1ff93945
commit 1c47bd88c1
3 changed files with 35 additions and 0 deletions

View file

@ -108,4 +108,29 @@ class TestQueue < Test::Unit::TestCase
end
}
end
def test_queue_push_return_value
q = Queue.new
retval = q.push(1)
assert_same q, retval
end
def test_queue_clear_return_value
q = Queue.new
retval = q.clear
assert_same q, retval
end
def test_sized_queue_push_return_value
q = SizedQueue.new(1)
retval = q.push(1)
assert_same q, retval
end
def test_sized_queue_clear_return_value
q = SizedQueue.new(1)
retval = q.clear
assert_same q, retval
end
end