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 6dec44e commit c1ab8caCopy full SHA for c1ab8ca
spec/concurrent/atomic/semaphore_spec.rb
@@ -112,6 +112,28 @@
112
expect(semaphore.available_permits).to eq 0
113
end
114
115
+
116
+ describe '#release' do
117
+ it 'increases the number of available permits by one' do
118
+ semaphore.release
119
+ expect(semaphore.available_permits).to eq 4
120
+ end
121
122
+ context 'when a number of permits is specified' do
123
+ it 'increases the number of available permits by the specified value' do
124
+ semaphore.release(2)
125
+ expect(semaphore.available_permits).to eq 5
126
127
128
+ context 'when permits is set to zero' do
129
+ it do
130
+ expect {
131
+ semaphore.release(0)
132
+ }.to raise_error(ArgumentError)
133
134
135
136
137
138
139
module Concurrent
0 commit comments