lib/runner.rb in guillaumegentil-rspactor-0.2.3 vs lib/runner.rb in guillaumegentil-rspactor-0.2.4

- old
+ new

@@ -3,42 +3,34 @@ def self.load(drb = false) @inspector = Inspector.new @interactor = Interactor.new @drb = drb - puts "** RSpactor is now watching at '#{Dir.pwd}'" + puts "** RSpactor is now watching at '#{Dir.pwd}'#{' and using spec_server' if @drb}" if initial_spec_run_abort @interactor.start_termination_handler else @interactor.start_termination_handler run_all_specs end Listener.new do |files| - files_to_spec = [] - files.each do |file| - spec_file = @inspector.find_spec_file(file) - if spec_file - puts spec_file - files_to_spec << spec_file - end - end - run_spec_command(files_to_spec) unless files_to_spec.empty? + run_specs_for_files(files) end end def self.run_all_specs run_spec_command([@inspector.inner_spec_directory(Dir.pwd)]) end - def self.run_specs_for_files(files, verbose = false) + def self.run_specs_for_files(files) files_to_spec = [] files.each do |file| spec_file = @inspector.find_spec_file(file) - if spec_file - puts spec_file if verbose + if spec_file && !files_to_spec.include?(spec_file) + puts spec_file files_to_spec << spec_file end end run_spec_command(files_to_spec) unless files_to_spec.empty? end @@ -51,10 +43,10 @@ cmd = "RAILS_ENV=test; " cmd << "#{spec_runner_bin} " cmd << "#{locations} #{spec_opts(base_spec_root)} " cmd << "--drb " if @drb cmd << "-r #{File.dirname(__FILE__)}/../lib/resulting.rb -f RSpactorFormatter:STDOUT" - puts cmd + # puts cmd system(cmd) end end def self.extract_spec_root(file) \ No newline at end of file