fix spec filtering

This commit is contained in:
John Bintz 2011-12-02 18:37:14 -05:00
parent f3dd4f2bf8
commit 3b0a11edea
2 changed files with 13 additions and 2 deletions

View File

@ -118,7 +118,12 @@ module Jasmine::Headless
if is_outside_scope = !spec_filter.empty?
is_outside_scope = spec_dir.any? do |dir|
spec_file_searches.any? do |search|
!spec_files.any? { |file| File.fnmatch?(File.join(dir, search), file) }
!spec_files.any? do |file|
target = File.join(dir, search)
p target
File.fnmatch?(target, file) || File.fnmatch?(target.gsub(%{^**/}, '').tap { |o| p o }, file)
end
end
end
end

View File

@ -78,8 +78,14 @@ module Jasmine
)
@_targets = template_writer.write!(files_list)
run_targets = @_targets.dup
run_targets.pop if (!@options[:full_run] && files_list.filtered?) || files_list.has_spec_outside_scope?
if run_targets.length == 2
if (!@options[:full_run] && files_list.filtered?) || files_list.has_spec_outside_scope?
run_targets.pop
end
end
system jasmine_command(run_targets)