Skip to content
This repository has been archived by the owner on Jan 10, 2024. It is now read-only.

Add support for sprockets stub directive #179

Open
mattduggan opened this issue Dec 8, 2015 · 2 comments
Open

Add support for sprockets stub directive #179

mattduggan opened this issue Dec 8, 2015 · 2 comments

Comments

@mattduggan
Copy link

Using rails v4.2.2, sprockets v3.4.0, sprockets-rails v2.3.3, jasmine-rails v0.12.2

In my application.js, I'm requiring a custom build of lodash (2.4.1) for compatibility with underscore/backbone. The app imports widgets, through Bower and bower-rails setup, which require lodash (3). To force the app to use 2.4.1, I've stub-bed them out after the first require.

/** application.js */
// include from vendor/assets/javascripts/
//= require lodash-2.4.1.custom
// ignore from vendor/assets/bower_components
//= stub lodash/lodash

/** require widget.rails */
//= require lodash/lodash
//= require foo/bar

The app site is behaving as expected and not including lodash 3, but Jasmine spec runner is, causing specs to fail. I can verify that it is exclusive to lodash and the require call, no other assets are getting included extraneously.

/** jasmine.yml */
src_dir: "app/assets/javascripts"
css_dir: "app/assets/stylesheets"
src_files:
 - "application.{js.coffee,js,coffee}"

helpers:
  - "helpers/**/*.{js.coffee,js,coffee}"

spec_dir: spec/javascripts
spec_files:
  - "**/*[Ss]pec.{js.coffee,js,coffee}"

tmp_dir: "tmp/jasmine"
@searls
Copy link
Member

searls commented Dec 8, 2015

Cool. I wasn't aware of stub -- I assume that's a newer sprockets feature? In any case, a PR that investigates this and fixes it to work the same as the production manifest would be welcome

@mattduggan
Copy link
Author

@searls I'll see what I can come up with. And yes! stub was introduced in the newer versions of sprockets.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants