|
164 | 164 | end |
165 | 165 |
|
166 | 166 | describe '#length' do |
167 | | - context 'when batch contains requests' do |
168 | | - it 'returns the number of requests in the batch' do |
169 | | - batch = described_class.new([add_request, notify_notification, subtract_request]) |
| 167 | + it 'returns the number of requests in the batch' do |
| 168 | + batch = described_class.new([add_request, notify_notification, subtract_request]) |
170 | 169 |
|
171 | | - expect(batch.length).to eq(3) |
172 | | - end |
| 170 | + expect(batch.length).to eq(3) |
173 | 171 | end |
174 | 172 | end |
175 | 173 |
|
176 | 174 | describe '#map' do |
177 | 175 | let(:batch) { described_class.new([add_request, notify_notification, subtract_request]) } |
178 | 176 |
|
179 | | - context 'when transforming each request' do |
180 | | - it 'returns array of transformed values' do |
181 | | - methods = batch.map(&:method) |
| 177 | + it 'returns array of transformed values' do |
| 178 | + methods = batch.map(&:method) |
182 | 179 |
|
183 | | - expect(methods).to eq(%w[add notify subtract]) |
184 | | - end |
| 180 | + expect(methods).to eq(%w[add notify subtract]) |
185 | 181 | end |
186 | 182 | end |
187 | 183 |
|
|
315 | 311 | end |
316 | 312 |
|
317 | 313 | describe '#requests' do |
318 | | - context 'when accessing the requests attribute' do |
319 | | - it 'returns the array of requests' do |
320 | | - requests = [add_request, notify_notification] |
321 | | - batch = described_class.new(requests) |
| 314 | + it 'returns the array of requests' do |
| 315 | + requests = [add_request, notify_notification] |
| 316 | + batch = described_class.new(requests) |
322 | 317 |
|
323 | | - expect(batch.requests).to eq(requests) |
324 | | - expect(batch.requests).to be_a(Array) |
325 | | - end |
| 318 | + expect(batch.requests).to eq(requests) |
| 319 | + expect(batch.requests).to be_a(Array) |
326 | 320 | end |
327 | 321 | end |
328 | 322 |
|
|
0 commit comments