Guest User

Untitled

a guest
Jan 23rd, 2019
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. stdout, status = Open3.capture2(command)
  2.  
  3. if status.success?
  4. puts stdout
  5. else
  6. puts stdout
  7. throw "error: could not execute"
  8. end
  9.  
  10. it "throws an error" do
  11. status = double("status message", :success? => false)
  12. allow(Open3).to receive(:capture2).and_return("wat?", status)
  13. ScreenShotWorker.new.perform(url: "www.google.com")
  14. expect(Open3).to have_received(:capture2)
  15. end
Add Comment
Please, Sign In to add comment