diff --git a/lib/jasmine/files_list.rb b/lib/jasmine/files_list.rb index 758078e..c20f83b 100644 --- a/lib/jasmine/files_list.rb +++ b/lib/jasmine/files_list.rb @@ -100,7 +100,15 @@ module Jasmine end def spec_filter - @spec_filter ||= (@options[:only] ? @options[:only].collect { |path| Dir[path] }.flatten : []) + return @spec_filter if @spec_filter + + @spec_filter = begin + if @options[:only] + @options[:only].collect { |path| expanded_dir(path) }.flatten + else + [] + end + end end def use_config! @@ -112,7 +120,7 @@ module Jasmine data[searches].flatten.collect do |search| path = search path = File.join(data[root], path) if data[root] - found_files = Dir[path] - @files + found_files = expanded_dir(path) - @files @files += found_files @@ -136,6 +144,10 @@ module Jasmine def config? @options[:config] end + + def expanded_dir(path) + Dir[path].collect { |file| File.expand_path(file) } + end end end diff --git a/spec/bin/jasmine-headless-webkit_spec.rb b/spec/bin/jasmine-headless-webkit_spec.rb index 1efe50c..72845c0 100644 --- a/spec/bin/jasmine-headless-webkit_spec.rb +++ b/spec/bin/jasmine-headless-webkit_spec.rb @@ -1,4 +1,5 @@ require 'spec_helper' +require 'tempfile' describe "jasmine-headless-webkit" do let(:report) { 'spec/report.txt' } @@ -122,8 +123,8 @@ describe "jasmine-headless-webkit" do files = %x{bin/jasmine-headless-webkit -l -j spec/jasmine/success/success.yml} $?.exitstatus.should == 0 - files.lines.to_a.should include("./spec/jasmine/success/success.js\n") - files.lines.to_a.should include("./spec/jasmine/success/success_spec.js\n") + files.lines.to_a.should include(File.expand_path("./spec/jasmine/success/success.js\n")) + files.lines.to_a.should include(File.expand_path("./spec/jasmine/success/success_spec.js\n")) end end