Skip to content

Commit

Permalink
Fixed autotest for paths with spaces
Browse files Browse the repository at this point in the history
- Closes #132.
  • Loading branch information
zargony authored and dchelimsky committed Sep 2, 2010
1 parent 4dc8bfb commit 5aa6ae3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/autotest/rspec2.rb
Expand Up @@ -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
Expand Down
7 changes: 7 additions & 0 deletions spec/autotest/rspec_spec.rb
Expand Up @@ -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
Expand Down

0 comments on commit 5aa6ae3

Please sign in to comment.