diff --git a/lib/pronto/runner.rb b/lib/pronto/runner.rb index 2f232eed..a22c5e03 100644 --- a/lib/pronto/runner.rb +++ b/lib/pronto/runner.rb @@ -21,6 +21,7 @@ def rake_file?(path) end def ruby_executable?(path) + return false if File.directory?(path) line = File.open(path, &:readline) line =~ /#!.*ruby/ rescue ArgumentError, EOFError diff --git a/spec/pronto/runner_spec.rb b/spec/pronto/runner_spec.rb index aa4f1379..8866b72d 100644 --- a/spec/pronto/runner_spec.rb +++ b/spec/pronto/runner_spec.rb @@ -34,6 +34,12 @@ module Pronto it { should be_falsy } end end + + context 'directory' do + let(:path) { 'directory' } + before { File.stub(:directory?).with(path).and_return(true) } + it { should be_falsy } + end end end end