diff --git a/lib/jasmine/headless/files_list.rb b/lib/jasmine/headless/files_list.rb index bfafd89..403a4e4 100644 --- a/lib/jasmine/headless/files_list.rb +++ b/lib/jasmine/headless/files_list.rb @@ -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 diff --git a/lib/jasmine/headless/runner.rb b/lib/jasmine/headless/runner.rb index df95b89..1337123 100644 --- a/lib/jasmine/headless/runner.rb +++ b/lib/jasmine/headless/runner.rb @@ -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)