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

Commit

Permalink
Merge pull request #197 from f1sherman/allow-globbing-in-spec-dir
Browse files Browse the repository at this point in the history
Allow globbing in spec_dir in jasmine.yml
  • Loading branch information
searls authored Aug 30, 2016
2 parents 7b17aea + 404c45c commit 85a86f8
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/jasmine-rails.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def route_path

def spec_dir
paths = jasmine_config['spec_dir'] || 'spec/javascripts'
[paths].flatten.collect { |path| Rails.root.join(path) }
[paths].flatten.map { |path| Dir.glob path }.flatten.collect { |path| Rails.root.join(path) }
end

def include_dir
Expand Down
4 changes: 4 additions & 0 deletions run-tests.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/usr/bin/env ruby

require 'fileutils'

def run(cmd)
system(cmd)
raise "`#{cmd}` exited non-zero (#{$?}). Exiting." if $? != 0
Expand All @@ -9,6 +11,8 @@ def run(cmd)
run 'rm -rf example-app'
run 'bundle exec rails new example-app --skip-gemfile --skip-bundle'
Dir.chdir('example-app')
run 'bundle exec rails plugin new engines/myengine --full --skip-gemspec'
FileUtils.mkdir_p 'engines/myengine/spec/javascripts'

puts '<--- Preparing app'
run 'rails g jasmine_rails:install'
Expand Down
4 changes: 3 additions & 1 deletion spec/javascripts/support/jasmine.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ src_files:
css_files:
- "support.{css,css.sass}"

spec_dir: ../spec/javascripts
spec_dir:
- "../spec/javascripts"
- "../engines/*/spec/javascripts"

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

0 comments on commit 85a86f8

Please sign in to comment.