title: what sleep() does Rails use?
body: <p>I am testing a piece of Rails code that reads:</p>
  
  <pre><code>sleep(10.0)
  </code></pre>
  
  <p>In my RSpec tests, calling:</p>
  
  <pre><code>Kernel.should_receive(:sleep).exactly(1).time
  </code></pre>
  
  <p>failed and the test slept for ten seconds.  This led me to conclude that <code>sleep()</code> in a Rails program isn't calling <code>Kernel.sleep()</code>.  I verified this by changing my Rails code to:</p>
  
  <pre><code>Kernel.sleep(10.0)
  </code></pre>
  
  <p>... after which my RSpec tests passed (and the test didn't sleep).</p>
  
  <p>This leads to a specific and a general question:</p>
  
  <ul>
  <li>What implementation of sleep() does Rails use (I'm running Ruby 1.9.3 / Rails 3.2.1)?</li>
  <li>From the interpreter, what's the easiest way to find the source code for any function?</li>
  </ul>