diff --git a/Guardfile b/Guardfile index 38c2dc6..512beef 100644 --- a/Guardfile +++ b/Guardfile @@ -3,6 +3,7 @@ # watch('file/path') { `command(s)` } # +if false guard 'coffeescript', :input => 'vendor/assets/coffeescripts', :output => 'vendor/assets/javascripts' guard 'shell' do @@ -21,6 +22,7 @@ guard 'rspec', :version => 2, :all_on_start => false do watch(%r{^bin/(.+)}) { |m| "spec/bin/#{m[1]}_spec.rb" } watch('spec/spec_helper.rb') { "spec" } end +end guard 'jasmine-headless-webkit', :all_on_start => false do watch(%r{^spec/javascripts/.+_spec\.coffee}) diff --git a/lib/jasmine/headless/command_line.rb b/lib/jasmine/headless/command_line.rb index 94e1362..a746247 100644 --- a/lib/jasmine/headless/command_line.rb +++ b/lib/jasmine/headless/command_line.rb @@ -5,8 +5,6 @@ module Jasmine::Headless require 'coffee-script' require 'rainbow' - FilesList.reset! - begin options = Options.from_command_line runner = Runner.new(options) diff --git a/lib/jasmine/headless/files_list.rb b/lib/jasmine/headless/files_list.rb index 7291154..404e407 100644 --- a/lib/jasmine/headless/files_list.rb +++ b/lib/jasmine/headless/files_list.rb @@ -61,7 +61,7 @@ module Jasmine::Headless @potential_files_to_filter = [] self.class.default_files.each do |file| - @required_files << RequiredFile.new(*path_searcher.find(file.dup), self) + @required_files << RequiredFile.new(*[ path_searcher.find(file.dup), self ].flatten) end use_config! if config? @@ -205,7 +205,15 @@ module Jasmine::Headless end end - @required_files.uniq!(&:path) + filtered_required_files = [] + + @required_files.each do |file| + if !filtered_required_files.any? { |other_file| other_file == file } + filtered_required_files << file + end + end + + @required_files = filtered_required_files end def config? diff --git a/lib/jasmine/headless/required_file.rb b/lib/jasmine/headless/required_file.rb index c20ab09..dd28b82 100644 --- a/lib/jasmine/headless/required_file.rb +++ b/lib/jasmine/headless/required_file.rb @@ -62,7 +62,7 @@ module Jasmine::Headless files.collect do |file| if result = path_searcher.find(file) - self.class.new(*result, self) + self.class.new(*[ result, self ].flatten) else raise Sprockets::FileNotFound.new("Could not find #{file}, referenced from #{path}:#{line}") end diff --git a/lib/jasmine/headless/runner.rb b/lib/jasmine/headless/runner.rb index cc225c9..33de5c9 100644 --- a/lib/jasmine/headless/runner.rb +++ b/lib/jasmine/headless/runner.rb @@ -69,6 +69,7 @@ module Jasmine def run Jasmine::Headless::CacheableAction.enabled = @options[:enable_cache] + FilesList.reset! files_list = Jasmine::Headless::FilesList.new( :config => jasmine_config, diff --git a/vendor/assets/coffeescripts/jasmine-extensions.coffee b/vendor/assets/coffeescripts/jasmine-extensions.coffee index a06150e..561cf9c 100644 --- a/vendor/assets/coffeescripts/jasmine-extensions.coffee +++ b/vendor/assets/coffeescripts/jasmine-extensions.coffee @@ -73,7 +73,11 @@ if window.JHW pauseAndRun = (onComplete) -> JHW.timerPause() + if this.env.reporter.reportSpecWaiting + this.env.reporter.reportSpecWaiting(this) this._execute -> + if this.env.reporter.reportSpecRunning + this.env.reporter.reportSpecRunning(this) JHW.timerDone() onComplete()