Skip to content

Commit 3609a5f

Browse files
committed
Remove useless contexts
1 parent 74f383c commit 3609a5f

File tree

1 file changed

+11
-17
lines changed

1 file changed

+11
-17
lines changed

spec/jsonrpc/batch_request_spec.rb

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -164,24 +164,20 @@
164164
end
165165

166166
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])
170169

171-
expect(batch.length).to eq(3)
172-
end
170+
expect(batch.length).to eq(3)
173171
end
174172
end
175173

176174
describe '#map' do
177175
let(:batch) { described_class.new([add_request, notify_notification, subtract_request]) }
178176

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)
182179

183-
expect(methods).to eq(%w[add notify subtract])
184-
end
180+
expect(methods).to eq(%w[add notify subtract])
185181
end
186182
end
187183

@@ -315,14 +311,12 @@
315311
end
316312

317313
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)
322317

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)
326320
end
327321
end
328322

0 commit comments

Comments
 (0)