addyosmani/backbone.paginator — pull request #131 by willsu (2013-01-29 00:17:49+00:00)
Title: Added .bootstrap method to clientPager and requestPager

#### This pull request is regarding the following issue:
https://github.com/addyosmani/backbone.paginator/issues/125

#### The (verbose) comment for this commit is as follows:
The .bootstrap(options) method was created for both the clientPage and requestPager. The clientPager should have this method called when it has been populated with all the Backbone collection data and need not call to the server. The requestPager should have this method called when the first page has been populated with all the Backbone collection and need not call to the server. Also, the .setDefaults() method was refactored out of the sync() method in the requestPager.

### Additional Details:
The .bootstrap method accepts options that will be extended by the receiving class instance. I found this functionality useful for the requestPager since you (likely) always want to bootstrap with the 'totalRecords' data (otherwise a request to the server would have to be made if you want to display initial page numbers). The clientPager.bootstrap method also accepts options for the class instance to extend (mostly just to keep their interfaces in sync).

I extracted a piece of code in the requestPager.sync method that appears to serve a very similar function to the clientPager.setDefaults method. I named the extracted method requestPager.setDefaults and refactored the test cases accordingly.

Regarding my approach to writing the test cases, I tried to keep them similar to how the other test cases were written in the class. I erred on the side of possibly testing the internals of other methods invoked in the chain (like .info() for instance) rather than using spies gratuitously. I felt like the heart of what I was trying to test revolved around the internal state of the pagination classes (like pager.information.totalPages and pager.information.currentPage being configured correctly).

Please let me know if there is anything you'd like me to change.