Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

A test to prevent regression of the E2BIG problem

  • Loading branch information...
commit 69bcf6e499105f86f5ee116c644de6c60fcdeb57 1 parent a16a50a
Jon Yurek jyurek authored
Showing with 9 additions and 1 deletion.
  1. +1 −1  lib/paperclip/helpers.rb
  2. +8 −0 test/paperclip_test.rb
2  lib/paperclip/helpers.rb
View
@@ -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
8 test/paperclip_test.rb
View
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.