@@ -206,15 +206,15 @@ def initialize
206
206
let ( :file_path ) { '/some/file/path' }
207
207
208
208
let ( :file_response ) do
209
- file_body = Grape ::ServeFile ::FileBody . new ( file_path )
210
- Grape ::ServeFile :: FileResponse . new ( file_body )
209
+ file_body = Grape ::ServeStream ::FileBody . new ( file_path )
210
+ Grape ::ServeStream :: StreamResponse . new ( file_body )
211
211
end
212
212
213
213
before do
214
214
subject . file file_path
215
215
end
216
216
217
- it 'returns value wrapped in FileResponse ' do
217
+ it 'returns value wrapped in StreamResponse ' do
218
218
expect ( subject . file ) . to eq file_response
219
219
end
220
220
end
@@ -223,14 +223,14 @@ def initialize
223
223
let ( :file_object ) { Class . new }
224
224
225
225
let ( :file_response ) do
226
- Grape ::ServeFile :: FileResponse . new ( file_object )
226
+ Grape ::ServeStream :: StreamResponse . new ( file_object )
227
227
end
228
228
229
229
before do
230
230
subject . file file_object
231
231
end
232
232
233
- it 'returns value wrapped in FileResponse ' do
233
+ it 'returns value wrapped in StreamResponse ' do
234
234
expect ( subject . file ) . to eq file_response
235
235
end
236
236
end
@@ -243,7 +243,7 @@ def initialize
243
243
244
244
describe '#stream' do
245
245
describe 'set' do
246
- let ( :file_object ) { Class . new }
246
+ let ( :file_object ) { double ( 'StreamerObject' , each : nil ) }
247
247
248
248
before do
249
249
subject . header 'Cache-Control' , 'cache'
@@ -252,12 +252,12 @@ def initialize
252
252
subject . stream file_object
253
253
end
254
254
255
- it 'returns value wrapped in FileResponse ' do
256
- expect ( subject . stream ) . to eq Grape ::ServeFile :: FileResponse . new ( file_object )
255
+ it 'returns value wrapped in StreamResponse ' do
256
+ expect ( subject . stream ) . to eq Grape ::ServeStream :: StreamResponse . new ( file_object )
257
257
end
258
258
259
- it 'also sets result of file to value wrapped in FileResponse ' do
260
- expect ( subject . file ) . to eq Grape ::ServeFile :: FileResponse . new ( file_object )
259
+ it 'also sets result of file to value wrapped in StreamResponse ' do
260
+ expect ( subject . file ) . to eq Grape ::ServeStream :: StreamResponse . new ( file_object )
261
261
end
262
262
263
263
it 'sets Cache-Control header to no-cache' do
0 commit comments