Sha256: 54e4e78db690556b2b362d04288f3944faf191d84856ff983fca93bf7674da17
Contents?: true
Size: 1.47 KB
Versions: 1
Compression:
Stored size: 1.47 KB
Contents
require 'spec_helper' describe Processor::OneShot do use_model_class(:Thing) before do Thing.has_attachment :attachment @thing = Thing.create(:attachment => test_empty_file) end def configure(&block) Thing.attachment_reflections[:attachment].configure(&block) end def process(&block) configure do process(:on => :event, :with => :one_shot, &block) end @thing.attachment.process(:event) end describe "any one shot processor", :shared => true do it "should run the process block exactly once" do num_runs = 0 process do num_runs += 1 end num_runs.should == 1 end it "should provide no styles to the process block" do styles = nil process do styles = self.styles end styles.should be_empty end it "should provide no style to the process block" do style = nil process do style = self.style end style.should be_nil end it "should provide no output files to the process block" do output_file = nil process do output_file = self.output_file(:one) end output_file.should be_nil end end describe "when there are no styles defined" do it_should_behave_like "any one shot processor" end describe "when there are multiple styles defined" do before do configure do style :one style :two end end it_should_behave_like "any one shot processor" end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
bulldog-0.0.1 | spec/unit/processor/one_shot_spec.rb |