Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- stdout, status = Open3.capture2(command)
- if status.success?
- puts stdout
- else
- puts stdout
- throw "error: could not execute"
- end
- it "throws an error" do
- status = double("status message", :success? => false)
- allow(Open3).to receive(:capture2).and_return("wat?", status)
- ScreenShotWorker.new.perform(url: "www.google.com")
- expect(Open3).to have_received(:capture2)
- end
Add Comment
Please, Sign In to add comment