Jasmine: define separate source file sets for Rails?
Separate parts of my site have separate sets of Javascript files, which -thrown all together- interfere with each other. In order to test everything with Jasmine, 开发者_如何转开发it seems I need some way to define separate sets of "assets" for different suites. Is this currently possible and if so, how?
You may want to consider, as suggested, breaking your javascript into different namespaces. One great way to make it easy to separate javascript into multiple files is by using the module pattern which uses closures and a few other neat properties of javascript to execute necessary code immediately, and contain it.
精彩评论