We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
<<
1 parent f55c03d commit b109d90Copy full SHA for b109d90
lib/concurrent/edge/lock_free_linked_set.rb
@@ -55,7 +55,8 @@ def add(item)
55
#
56
# @return [Oject] the set on which the :<< method was invoked
57
def <<(item)
58
- self if add item
+ add item
59
+ self
60
end
61
62
# @!macro [attach] lock_free_linked_list_method_contains
spec/concurrent/edge/lock_free_linked_set_spec.rb
@@ -44,6 +44,11 @@
44
it 'appends to the linked set and returns self' do
45
expect(subject << 'test string1').to be_a described_class
46
47
+
48
+ it 'returns self regardless of whether it was logically added' do
49
+ subject << 'test string'
50
+ expect(subject << 'test string').to be_a described_class
51
+ end
52
53
54
describe '#contains?' do
0 commit comments