-
Notifications
You must be signed in to change notification settings - Fork 284
Development
git clone git@github.com:websocket-rails/websocket-rails.git
If you are planning on submitting a pull request, fork the project to your own account first and clone it from there.
cd websocket-rails
bundle install
bundle exec rake
The full test suite includes the Jasmine tests for the JavaScript client. The default rake task will open up firefox in a browser window for a second or two and then close it after the rspec suite has finished.
You can run the Jasmine suite headlessly using the rake jasmine:ci
command.
bundle exec guard
[1] guard(main)>
The Guardfile included with the repository is configured to automatically run any specs related to the file you are editing after you save that file.
It is also configured to compile the CoffeeScript specs to plain JavaScript so Jasmine can read them. As soon as you save one of the Jasmine specs in spec/javascripts/websocket_rails
, Guard will regenerate the compiled file in the correct location for Jasmine.
If you are making any changes to the JavaScript client you will need to start the Jasmine server.
rake jasmine
your tests are here:
http://localhost:8888/
Make sure to start Guard and run it once by pressing <enter>
in order to compile the CoffeeScript files to JavaScript. If you do not do this, Jasmine will show zero specs when visiting the Jasmine URL for the first time. Leave Guard running to automatically recompile the CoffeeScript files after you save a file.
Once the Jasmine server has started, browse to the location listed in your console to view the spec output. You will need to manually refresh this page after making any changes to the JavaScript client or specs. Ensure you followed step #4 so that your changes are compiled upon save of the file.
Write a spec. Watch it fail. Add the code to make it pass. Rinse. Repeat.
Happy coding!