Skip to content
This repository has been archived by the owner on Jul 13, 2023. It is now read-only.

Commit

Permalink
A test to prevent regression of the E2BIG problem
Browse files Browse the repository at this point in the history
  • Loading branch information
Jon Yurek committed Sep 28, 2012
1 parent a16a50a commit 69bcf6e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/paperclip/helpers.rb
Expand Up @@ -24,7 +24,7 @@ def interpolates key, &block
#
def run(cmd, arguments = "", local_options = {})
command_path = options[:command_path]
Cocaine::CommandLine.path = ( Cocaine::CommandLine.path ? [Cocaine::CommandLine.path].flatten | [command_path] : command_path )
Cocaine::CommandLine.path = [Cocaine::CommandLine.path, command_path].flatten.compact.uniq
local_options = local_options.merge(:logger => logger) if logging? && (options[:log_command] || local_options[:log_command])
Cocaine::CommandLine.new(cmd, arguments, local_options).run
end
Expand Down
8 changes: 8 additions & 0 deletions test/paperclip_test.rb
Expand Up @@ -33,6 +33,14 @@ class PaperclipTest < Test::Unit::TestCase
end
end

should 'not raise errors when doing a lot of running' do
Paperclip.options[:command_path] = ["/usr/local/bin"] * 1024
Cocaine::CommandLine.path = "/something/else"
100.times do |x|
Paperclip.run("echo", x.to_s)
end
end

context "Calling Paperclip.log without options[:logger] set" do
setup do
Paperclip.logger = nil
Expand Down

0 comments on commit 69bcf6e

Please sign in to comment.