title: Calling $(document).ready(function() {...}); from another file
body: <p>As the title suggested, I'm trying to call the $(document).ready(function() {...}); from another file.  The code snippet is as below:</p>
  
  <p>Source file:</p>
  
  <pre><code>$(document).ready(function () {
      alert('document.ready function called!');
      // a lot of code
  }
  </code></pre>
  
  <p>And in the test file:</p>
  
  <pre><code>TestFile.prototype.testDocumentReadyContents = function () {
      // test code here trying to call the document.ready function
  }
  </code></pre>
  
  <p>I haven't had any success on it yet.  I have tried document.ready.apply(), trigger('ready'), overriding the document.ready function... but just couldn't call it.  FYI I'm invoking it as part of my unit test.</p>
  
  <p>Thanks.</p>