ungulate 0.1.4 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/bin/ungulate_server.rb +22 -7
- data/features/image_resize.feature +2 -12
- data/features/notification_url.feature +14 -0
- data/features/resize_then_composite.feature +2 -1
- data/features/step_definitions/bucket_steps.rb +4 -0
- data/features/step_definitions/command_steps.rb +10 -1
- data/features/step_definitions/notification_steps.rb +23 -0
- data/features/step_definitions/queue_steps.rb +7 -21
- data/features/step_definitions/version_steps.rb +2 -2
- data/features/{support.rb → support/config.rb} +4 -0
- data/features/support/helpers.rb +21 -0
- data/features/support/put_server.rb +22 -0
- data/lib/ungulate.rb +64 -0
- data/lib/ungulate/blob_processor.rb +34 -0
- data/lib/ungulate/curl_http.rb +25 -0
- data/lib/ungulate/file_upload.rb +22 -16
- data/lib/ungulate/job.rb +23 -143
- data/lib/ungulate/rmagick_version_creator.rb +77 -0
- data/lib/ungulate/s3_storage.rb +41 -0
- data/lib/ungulate/server.rb +27 -7
- data/lib/ungulate/sqs_message_queue.rb +38 -0
- data/spec/fixtures/chuckle.jpg +0 -0
- data/spec/fixtures/chuckle.png +0 -0
- data/spec/fixtures/chuckle_converted.png +0 -0
- data/spec/fixtures/chuckle_converted_badly.png +0 -0
- data/spec/fixtures/chuckle_thumbnail.png +0 -0
- data/spec/fixtures/watermark.png +0 -0
- data/spec/lib/ungulate/blob_processor_spec.rb +68 -0
- data/spec/lib/ungulate/curl_http_spec.rb +20 -0
- data/spec/{ungulate → lib/ungulate}/file_upload_spec.rb +10 -27
- data/spec/lib/ungulate/job_spec.rb +120 -0
- data/spec/lib/ungulate/rmagick_version_creator_spec.rb +97 -0
- data/spec/lib/ungulate/s3_storage_spec.rb +74 -0
- data/spec/lib/ungulate/server_spec.rb +44 -0
- data/spec/lib/ungulate/sqs_message_queue_spec.rb +28 -0
- data/spec/{ungulate → lib/ungulate}/view_helpers_spec.rb +1 -1
- data/spec/lib/ungulate_spec.rb +24 -0
- data/spec/spec_helper.rb +73 -0
- metadata +67 -25
- data/spec/ungulate/job_spec.rb +0 -386
- data/spec/ungulate/server_spec.rb +0 -42
@@ -1,42 +0,0 @@
|
|
1
|
-
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')
|
2
|
-
require 'ungulate/server'
|
3
|
-
|
4
|
-
module Ungulate
|
5
|
-
describe Server do
|
6
|
-
describe "run" do
|
7
|
-
before do
|
8
|
-
@versions = {
|
9
|
-
:thumb => [ :resize_to_fit, 100, 200 ],
|
10
|
-
:large => [ :resize_to_fit, 200, 300 ],
|
11
|
-
}
|
12
|
-
|
13
|
-
@data = mock('Data')
|
14
|
-
@job = mock('Job',
|
15
|
-
:versions => @versions,
|
16
|
-
:source => @data,
|
17
|
-
:process => nil,
|
18
|
-
:store => nil)
|
19
|
-
|
20
|
-
Job.stub(:pop).and_return(@job)
|
21
|
-
|
22
|
-
@image = mock('RMagick::Image')
|
23
|
-
|
24
|
-
@datum = mock('Datum')
|
25
|
-
@data_array = [@datum]
|
26
|
-
|
27
|
-
Magick::Image.stub(:from_blob).with(@data).and_return(@data_array)
|
28
|
-
end
|
29
|
-
|
30
|
-
after { Ungulate::Server.run('queuename') }
|
31
|
-
|
32
|
-
it "should pop a job from the provided queue" do
|
33
|
-
Job.should_receive(:pop).with('queuename')
|
34
|
-
end
|
35
|
-
|
36
|
-
it "should process the job" do
|
37
|
-
@job.should_receive(:process)
|
38
|
-
end
|
39
|
-
end
|
40
|
-
end
|
41
|
-
end
|
42
|
-
|