title: How to test internal functions, which are needed for internal purposes, using Jasmine
body: <pre><code>(function(window,document){
  
    var _trimString = function( string ){
       var trimString;
       trimString = string.replace(/^\s+|\s+$/g,'');
       return trimString
    };
  
    var displayCorrectText = function( incorrecttext ){
       correctText = "."+incorrecttext;
       document.write( correctText );
    }
  
    var Circular = function(){};
  
    Circular.prototype.init = function( string ){
       displayCorrectText( _trimString( string ) );
    };
  
    var circular = new Circular();
    window.circular = circular;
  })(window,document);
  
  circular.init('asd.asd');
  </code></pre>
  
  <p>I have this module declaration and i want to test <strong>_trimString</strong> function using Jasmine.</p>
  
  <p>i wrote something like this code</p>
  
  <pre><code>describe("Form Creator private function ", function(){
  it("_trimString should trim string", function(){
      var _trimString = function( string ){
          var trimString;
          trimString = string.replace(/^\s+|\s+$/g,'');
  
          return trimString
      };
   expect(_trimString('   test text  ') ).toBe('test text');
  });
  </code></pre>
  
  <p>}); </p>
  
  <p>I'm doing it right, declaring the function itself in the test, or is there another way?
  if I did so function test, I think, wrong to copy the actual function in the source code. Maybe, someone could show me right case of using "private" function in module declaration</p>