diff --git a/README.md b/README.md
index e06eb61..314f26f 100644
--- a/README.md
+++ b/README.md
@@ -44,9 +44,8 @@ These options can also be placed into a `.jasmine-headless-webkit` file in your
### CoffeeScript Support
-`jasmine-headless-webkit` brings in the `coffee-script-source` gem and allows you to run CoffeeScript
-files without needing compilation. It uses [the `}
when '.coffee'
- %{}
+ %{}
when '.css'
%{}
end
diff --git a/jasmine-headless-webkit.gemspec b/jasmine-headless-webkit.gemspec
index 47020bd..da6959c 100644
--- a/jasmine-headless-webkit.gemspec
+++ b/jasmine-headless-webkit.gemspec
@@ -21,5 +21,5 @@ Gem::Specification.new do |s|
s.require_paths = ["lib"]
s.add_dependency 'jasmine'
- s.add_dependency 'coffee-script-source'
+ s.add_dependency 'coffee-script'
end
diff --git a/lib/autotest/jasmine_mixin.rb b/lib/autotest/jasmine_mixin.rb
index 64f8fb8..71e73b5 100644
--- a/lib/autotest/jasmine_mixin.rb
+++ b/lib/autotest/jasmine_mixin.rb
@@ -1,7 +1,7 @@
module JasmineMixin
JASMINE_PROGRAM = File.expand_path('../../../bin/jasmine-headless-webkit', __FILE__)
- JAVASCRIPT_EXTENSIONS = %w{js}
+ JAVASCRIPT_EXTENSIONS = %w{js coffee}
def self.included(klass)
klass::ALL_HOOKS << [ :run_jasmine, :ran_jasmine ]
@@ -81,12 +81,16 @@ module JasmineMixin
end
def setup_jasmine_project_mappings
- add_mapping(%r{spec/javascripts/.*_spec\.js}) { |filename, _|
+ add_mapping(%r{spec/javascripts/.*_spec\.(js|coffee)}) { |filename, _|
filename
}
add_mapping(%r{public/javascripts/(.*)\.js}) { |_, m|
- [ "spec/javascripts/#{m[1]}_spec.js" ]
+ files_matching(%{spec/javascripts/#{m[1]}_spec\..*$})
+ }
+
+ add_mapping(%r{app/coffeescripts/(.*)\.coffee}) { |_, m|
+ files_matching(%{spec/javascripts/#{m[1]}_spec\..*$})
}
end