Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 892
Pascal Lindelauf Avatar asked Jul 07 '11 11:07

Pascal Lindelauf


1 Answers

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.

like image 90
NT3RP Avatar answered Sep 27 '22 22:09

NT3RP