-
Notifications
You must be signed in to change notification settings - Fork 242
Migrating from Jasminerice
The Jasminerice project is no longer being maintained by it's creator, which is a bummer. I've contributed to the project to keep it alive, but until someone has access to release the gem it's difficult to properly maintain releases, bug fixes, and dependency updates.
Because of this I would encourage people using Jasminerice to migrate to another runner for future and potentially current projects.
This page provides migration steps for Teaspoon, and at the bottom provides a list of alternative projects that might be useful.
While migration is fairly painless your results may vary.
- Remove Jasminerice from your Gemfile and delete the initializer (
config/initializers/jasminerice.rb
). - Add Teaspoon to your Gemfile with
gem "teaspoon-jasmine"
and install it withrails g teaspoon:install
- Rename
spec/javascripts/spec.js
tospec/javascripts/spec_helper.js
(or .js.coffee, etc.)
This is where it gets interesting. So, Teaspoon prefers that you name your files a specific way (filename_spec.js), while Jasminerice uses a manifest approach (requiring all your spec files from spec.js).
While you can use a manifest approach with Teaspoon, you lose some of the really cool features -- like running a single file instead of your entire suite.. Read on based on what you'd like to do.
Awesome! You'll just need to make sure your spec files are named properly (eg. filename_spec.js -- or js.coffee etc.)
Update your spec_helper to not require all the specs.. by default this is a require_tree .
directive, but you may have changed it.
If you're using jasmine-jquery you'll need to require it in your spec_helper (the fixture path will be set for you automatically).
//= require support/jasmine-jquery
Browse to /teaspoon
instead of /jasmine
.
That's cool, you'll just need to adjust your configuration a bit. Open up config/initializers/teaspoon.rb
and change the configuration for the default suite to this:
config.suite do |suite|
suite.matcher = nil
end
Browse to /teaspoon
instead of /jasmine
.. or if you'd rather, you can update the configuration further.
config.mount_at = "/jasmine"
If you're using jasmine-jquery you'll have to require it in your spec_helper (the fixture path will be set for you automatically).
//= require support/jasmine-jquery
When migrating from Jasminerice, you may have to deal with a change in syntax involving fixtures. You no longer need preloadFixtures()
calls, and you should change loadFixtures
to fixture.load
in all of your specs.
Here's a list of alternative projects that you might want to check out as well: