Permalink
Browse files

instead of asking the jasmine gem's configuration,

instead use JHW's configuration for determining
asset paths to be added to sprockets (this is 
more consistent, regardless)
  • Loading branch information...
1 parent 6b8fe5b commit bb23c5a8dbfc63d126e2259268862d7896f29403 @searls committed Dec 5, 2012
Showing with 10 additions and 5 deletions.
  1. +1 −5 config/initializers/sprockets.rb
  2. +9 −0 lib/jasmine_rails/jhw_adapter.rb
@@ -1,7 +1,3 @@
-require 'jasmine'
-require 'jasmine-core'
-
assets = Rails.application.assets
-
-assets.append_path Jasmine.config.spec_path
assets.append_path Jasmine::Core.path
+JasmineRails::JhwAdapter.new.asset_paths.each { |path| assets.append_path(path) }
@@ -26,6 +26,15 @@ def js_files
).files
end
+ def asset_paths
+ jasmine_config = YAML.load_file(Jasmine::Headless::Options.new[:jasmine_config])
+ [
+ jasmine_config["src_dir"],
+ jasmine_config["spec_dir"],
+ jasmine_config["asset_paths"]
+ ].flatten
+ end
+
def instantiate_runner
begin
Jasmine::Headless::Runner.new(@options)

0 comments on commit bb23c5a

Please sign in to comment.