Include batman test_case

58 Views Asked by At

I am trying to implement TDD in BatmanJS, but the Batman.TestCase class is an extra. How do i include it from github in my rails app as sugested here?

1

There are 1 best solutions below

0
On

Unfortunately, Batman.TestCase isn't included in any of the distributed builds for batman.js. If you want to use it, you'll have to copy the files yourself. You could get those files into your Rails project by cloning the Github repository, then copying the src/extras/testing directory into your project's app/assets/batman/extras/testing directory.

For example, you could run these commands in your terminal:

$ cd /path/to/your/projects
$ git clone [email protected]:batmanjs/batman.git  
$ mkdir -p your_project/app/assets/batman/extras/testing 
$ cp -R batman/src/extras/testing your_project/app/assets/batman/extras/testing 

Now, you should have all the contents of that directory inside your app and TestCase should be available on your development server at /assets/extras/testing/test_case.js.

(If it isn't there, try /assets/extras/test_case.js or just /assets/test_case.js. I know Sprockets does something special with asset paths, but I can't remember what!)

By the way, I've had good luck with just jasmine for tests :) Hope this helps!