Commit 69bcf6e4 by Jon Yurek

A test to prevent regression of the E2BIG problem

parent a16a50a1
...@@ -24,7 +24,7 @@ module Paperclip ...@@ -24,7 +24,7 @@ module Paperclip
# #
def run(cmd, arguments = "", local_options = {}) def run(cmd, arguments = "", local_options = {})
command_path = options[:command_path] 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]) local_options = local_options.merge(:logger => logger) if logging? && (options[:log_command] || local_options[:log_command])
Cocaine::CommandLine.new(cmd, arguments, local_options).run Cocaine::CommandLine.new(cmd, arguments, local_options).run
end end
......
...@@ -33,6 +33,14 @@ class PaperclipTest < Test::Unit::TestCase ...@@ -33,6 +33,14 @@ class PaperclipTest < Test::Unit::TestCase
end end
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 context "Calling Paperclip.log without options[:logger] set" do
setup do setup do
Paperclip.logger = nil Paperclip.logger = nil
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment