Skip to content
Browse files

Fixed autotest for paths with spaces

- Closes #132.
  • Loading branch information...
1 parent 4dc8bfb commit 5aa6ae39816801e5942ec24bff5dc3bb31e738e5 @zargony zargony committed with dchelimsky Sep 2, 2010
Showing with 8 additions and 1 deletion.
  1. +1 −1 lib/autotest/rspec2.rb
  2. +7 −0 spec/autotest/rspec_spec.rb
View
2 lib/autotest/rspec2.rb
@@ -38,7 +38,7 @@ def consolidate_failures(failed)
def make_test_cmd(files_to_test)
files_to_test.empty? ? '' :
- "#{ruby} #{require_rubygems}#{SPEC_PROGRAM} #{normalize(files_to_test).keys.flatten.join(' ')}"
+ "#{ruby} #{require_rubygems}#{SPEC_PROGRAM} #{normalize(files_to_test).keys.flatten.map { |f| "'#{f}'"}.join(' ')}"
end
def require_rubygems
View
7 spec/autotest/rspec_spec.rb
@@ -32,6 +32,13 @@
it "should return a blank command for no files" do
@rspec_autotest.make_test_cmd({}).should == ''
end
+
+ it "should quote the paths of files to test" do
+ cmd = @rspec_autotest.make_test_cmd(@files_to_test)
+ @files_to_test.keys.each do |file_to_test|
+ cmd.should =~ /'#{File.expand_path(file_to_test)}'/
+ end
+ end
end
describe "mappings" do

0 comments on commit 5aa6ae3

Please sign in to comment.
Something went wrong with that request. Please try again.