@@ -189,28 +189,30 @@ def create_screenshot(**options)
189
189
include_examples 'background_rgba_color ArgumentError' do
190
190
let ( :background_rgba_color ) do
191
191
r , g , b = 0 , 0 , 0
192
- [ r , g , b ]
192
+ [ r , g , b ]
193
193
end
194
194
end
195
195
196
196
include_examples 'background_rgba_color ArgumentError' do
197
- let ( :background_rgba_color ) { '#FFF' }
197
+ let ( :background_rgba_color ) { '#FFF' }
198
198
end
199
199
200
200
include_examples 'background_rgba_color ArgumentError' do
201
- let ( :background_rgba_color ) { %w[ 0 0 0 0 ] }
201
+ let ( :background_rgba_color ) { %w[ 0 0 0 0 ] }
202
202
end
203
203
204
204
it 'supports screenshotting page with the specific background color' do
205
- file = PROJECT_ROOT + "/spec/tmp/screenshot.jpeg"
206
- browser . go_to
207
- browser . screenshot ( path : file )
208
- content = File . read ( file )
209
- browser . screenshot ( path : file , background_rgba_color : [ 0 , 0 , 0 , 0.0 ] )
210
- content_with_specific_bc = File . read ( file )
211
- expect ( content ) . not_to eq ( content_with_specific_bc )
212
- ensure
213
- FileUtils . rm_f ( [ file ] )
205
+ begin
206
+ file = PROJECT_ROOT + "/spec/tmp/screenshot.jpeg"
207
+ browser . go_to
208
+ browser . screenshot ( path : file )
209
+ content = File . read ( file )
210
+ browser . screenshot ( path : file , background_rgba_color : [ 0 , 0 , 0 , 0.0 ] )
211
+ content_with_specific_bc = File . read ( file )
212
+ expect ( content ) . not_to eq ( content_with_specific_bc )
213
+ ensure
214
+ FileUtils . rm_f ( [ file ] )
215
+ end
214
216
end
215
217
end
216
218
0 commit comments