title: How can I validate exit value in rspec?
body: <p>I have a method that will sometimes call <code>exit(numeric_value)</code>.</p>
  
  <p>Is it possible for rspec to validate that when the method is invoked, the process is exiting with the correct value?</p>
  
  <p>I have seen these other posts, but they do not answer this specific question.</p>
  
  <ul>
  <li><a href="https://stackoverflow.com/questions/1480537/how-can-i-validate-exits-and-aborts-in-rspec">How can I validate exits and aborts in RSpec?</a></li>
  <li><a href="https://stackoverflow.com/questions/7019907/how-to-spec-methods-that-exit-or-abort">How to spec methods that exit or abort</a></li>
  </ul>