Write javascript specs inside a Ruby Gem

Hello guys!

So, I have this gem Initjs. I’m implementing more features and I’ll make a huge refactoring on the code base that is write in CoffeeScript.

Today the specs I have are using Capybara and Rspec, I think that is not good enough and would be better if it was unit tests (Jasmine) instead just Rspec tests.

The first question that I have is: That makes sense? Use unit tests instead of the tests It has today?
The second question and more hard is: How setup Jasmine to test inside the Gem and compile the coffeescripts files?

Please let me know if you have any questions.
Thanks.

I think it makes sense. Testing JS at the unit level via rspec and capybara will be tiresome - you’ll have a lot of scenarios and it will be slow.

Have a look at the teaspoon test runner. You can write and test CoffeeScript. It looks a little involved to set up, but it can handle Jasmine (or Qunit, or Mocha). I’m using it on a project now and it “just works”, though I admit that I didn’t have to do any of the setup for it.