Jasmine不会从资产管道加载javascript文件 [英] Jasmine won't load javascript files from asset pipeline
问题描述
我正在开发一个宝石,我已经安装了Jasmine https://github.com/pivotal / jasmine-gem /
I'm developing a gem and I've installed Jasmine https://github.com/pivotal/jasmine-gem/
我所需的所有JS文件都在app / assets / javascripts / application.js的清单文件中
All of my required JS files are in my manifest file at app/assets/javascripts/application.js
//= require underscore
//= require backbone
//= require_tree .//vendor
//= require_tree .//custom
//= require_tree .//templates
//= require_tree .//models
//= require_tree .//collections
//= require_tree .//views
我的jasmine.yml文件引用了:
And my jasmine.yml file references that:
src_files:
- 'app/assets/javascripts/application.js'
但是没有指定的文件加载。谁知道为什么?我正在使用最新的Jasmine 1.3.2,它应该支持资产管道,这样你就不需要使用像jasmine-rails这样的东西了。有什么想法?
But none of the files specified in it load. Anyone know why? I'm using the latest, Jasmine 1.3.2, which is supposed to support the asset pipeline so that you don't need to use something like jasmine-rails. Any thoughts?
推荐答案
在你的jasmine.yml中,路径应该是'assets / application.js'。如果您仍然遇到问题,请确保您的Gemfile中的开发和测试组都有jasmine gem,如 https://github.com/pivotal/jasmine-gem :
In your jasmine.yml the path should be 'assets/application.js'. If you're still having trouble, make sure you have your jasmine gem under both development and test groups in your Gemfile, as specified in the instructions on https://github.com/pivotal/jasmine-gem:
group :development, :test do
gem 'jasmine'
end
这篇关于Jasmine不会从资产管道加载javascript文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!