Sha256: 3a558601740e87e7ff9e3ae603d49195e63cc86b00271333e5ffa5720d32d9ca
Contents?: true
Size: 1.07 KB
Versions: 60
Compression:
Stored size: 1.07 KB
Contents
require 'spec_helper' describe Dragonfly::JobBuilder do describe "a multi-step job" do before(:each) do @job_builder = Dragonfly::JobBuilder.new do |size, format| process :thumb, size encode format unless format.nil? end end it "should correctly call job steps" do job = mock job.should_receive(:process).with(:thumb, '30x30#').and_return(job2=mock) job2.should_receive(:encode).with(:jpg).and_return(job3=mock) @job_builder.build(job, '30x30#', :jpg).should == job3 end it "should work consistently with bang methods" do job = mock job.should_receive(:process!).with(:thumb, '30x30#').and_return(job) job.should_receive(:encode!).with(:jpg).and_return(job) @job_builder.build!(job, '30x30#', :jpg).should == job end it "should yield nil if the arg isn't passed in" do job = mock job.should_receive(:process).with(:thumb, '30x30#').and_return(job2=mock) job2.should_not_receive(:encode) @job_builder.build(job, '30x30#').should == job2 end end end
Version data entries
60 entries across 60 versions & 3 rubygems