testdouble / jasmine-rails

A Jasmine runner for rails projects that's got you covered in both the terminal and the browser
http://rubygems.org/gems/jasmine-rails
MIT License
378 stars 154 forks source link

Getting Requirejs to properly do its thing with Jasmine #146

Closed AntiFish03 closed 9 years ago

AntiFish03 commented 9 years ago

...onsole.

Changes: Added capybara as a dependency Modified spec_runner_helper.rb Adjusted the way jasmine_js_files method loads in the event that requirejs is in use. Added access to the JasmineRails spec_files. Checking for a custom boot js and loading it in place of the other boot scripts. Modified spec_runner.html.erb Added logic to use requirejs if loaded. Set to load all specs as require deps. Modified jasmine-rails.rb Added support_dir to allow the boot.js to be defined next to the jasmine.yml Added custom_boot method to define the boot.js Modified install_generator.rb Added the creation of the rjs-boot.js Modified jasmine.yml Added support for custom boot.js Added rjs-boot.js Copied from Jasmine-core and modified to correctly work with requirejs Modified engine.rb Added the support path to the asset path Modified runner.rb Big changes here... If requirejs is defined we need to handle things a little differently here... we need to start up a server and allow requirejs and asset pipeline to do what they do. Trying to preload assets with requirejs is a nightmare and the only way to attempt it would be to run the requirejs optimizer (r.js) and that will potentially change the code that we are wanting to test.

searls commented 9 years ago

Sorry, but I'm not interested in pulling in Capybara, an RVM config, or Require.js support into jasmine-rails. Of course, I hope you're able to enjoy it working from your fork, but if you were hoping I would merge this I wish you'd discussed with me in an issue first before investing your time. :(

searls commented 9 years ago

Whoops, I see now you pinged me 9 days ago on issue #141 and I snoozed it. Because the title didn't indicate RequireJS I didn't see at a glance to jump in and let you know that I don't want to support it. I apologize for not replying promptly :(

AntiFish03 commented 9 years ago

Regardless I still needed it I only offered the PR as you had an open issue that this resolved... and I did attempt to discuss it before I fixed it.