Sha256: ce874579fc4faa6f9072e7332f9edc2348354ab60751c908a6e6574ccf41f980

Contents?: true

Size: 1.06 KB

Versions: 9

Compression:

Stored size: 1.06 KB

Contents

$LOAD_PATH.unshift(File.dirname(__FILE__) + '/../../lib')
require 'dragonfly'
require 'spec/expectations'
require 'test/unit/assertions'
require File.dirname(__FILE__) + '/../../spec/image_matchers.rb'

# A hack as system calls weren't using my path
extra_paths = %w(/opt/local/bin)
ENV['PATH'] ||= ''
ENV['PATH'] += ':' + extra_paths.join(':')

# A hash of <name for reference> => <dragonfly uid> pairs
TEMP_FILES = {}

Dragonfly::App[:images].configure_with(Dragonfly::RMagickConfiguration)
Dragonfly::App[:files].configure do |c|
  c.register_analyser(Dragonfly::Analysis::FileCommandAnalyser)
  c.register_encoder(Dragonfly::Encoding::TransparentEncoder)
end

SAMPLE_IMAGE_PATH = File.dirname(__FILE__)+'/../../samples/beach.png'

Before do
  # Remove temporary images
  TEMP_FILES.each do |name, uid|
    $app.datastore.destroy(uid)
    TEMP_FILES.delete(name)
  end
end

module MyHelpers
  
  def make_request(name, *args)
    request = Rack::MockRequest.new($app)
    url = $app.url_for(TEMP_FILES[name], *args)
    @response = request.get(url)
  end
  
end

World(MyHelpers)

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
dragonfly-0.5.7 features/support/env.rb
dragonfly-0.5.6 features/support/env.rb
dragonfly-0.5.5 features/support/env.rb
dragonfly-0.5.4 features/support/env.rb
dragonfly-0.5.3 features/support/env.rb
dragonfly-0.5.2 features/support/env.rb
dragonfly-0.5.1 features/support/env.rb
dragonfly-0.5.0 features/support/env.rb
dragonfly-0.4.4 features/support/env.rb