Interesting

  • Speed up your tests that use Paperclip by putting the following in your spec_helper.rb. In a new project's test suite this alone reduced the full suite run time from 25 to 5 seconds.
class Paperclip::Attachment
  def post_process; end
end
  • If you want to run Spork to speed up your tests, but aren't running on a Ruby platform that supports Kernel.fork (like windows or JRuby) then Roger Pack's Spork fork might work for you.

Comments

  1. Andrew Cantino Andrew Cantino on March 11, 2010 at 05:31PM

    Thanks! That prevented convert from being run, but you can take it further and prevent identify from running as well:

    class Paperclip::Attachment
      def post_process; end
    end
    
    module Paperclip
      class << self
        def run(*args)
          "100x100"
        end
      end
    end