diff --git a/spec/browser/xvfb_spec.rb b/spec/browser/xvfb_spec.rb index 6f5fd016..cbeb7b8a 100644 --- a/spec/browser/xvfb_spec.rb +++ b/spec/browser/xvfb_spec.rb @@ -50,7 +50,8 @@ expect(process.xvfb.screen_size).to eq("1024x768x24") ensure xvfb_browser&.quit - expect(process_alive?(process.xvfb.pid)).to be(false) + pid = process&.xvfb&.pid + expect(process_alive?(pid)).to be(false) if pid end end