Sha256: 6e646e8fe17a7c88d7997ed9e882751baa8d4c43cdaf541ec77bcf4563235944

Contents?: true

Size: 1.19 KB

Versions: 5

Compression:

Stored size: 1.19 KB

Contents

require 'spec_helper'

describe CarrierWave::Processor::Dsl do

  before :each do
    ::CarrierWave::Processor.processors = {}
  end

  it "returns processor node on carrierwave_processor call" do
    processor = carrierwave_processor(:some_processor){}
    processor.should be_kind_of Hash
  end

  it "stores processor to centralized hash storage" do
    carrierwave_processor(:another_processor){}
    ::CarrierWave::Processor.processors.should have_key :another_processor
  end

  it "saves new processor to storage if same key given" do
    first_processor = carrierwave_processor(:processor){}
    ::CarrierWave::Processor.processors[:processor].should be_equal first_processor
    second_processor = carrierwave_processor(:processor){}
    ::CarrierWave::Processor.processors[:processor].should_not be_equal first_processor
    ::CarrierWave::Processor.processors[:processor].should be_equal second_processor
  end

  it "does not save inner processor to global storage but save it to local storage" do
    outer_processor = carrierwave_processor(:processor) do
      carrierwave_processor(:another_processor){}
    end
    ::CarrierWave::Processor.processors.should_not have_key :another_processor
  end

  
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
carrierwave-processor-1.1.2 spec/dsl_spec.rb
carrierwave-processor-1.1.1 spec/dsl_spec.rb
carrierwave-processor-1.1.0 spec/dsl_spec.rb
carrierwave-processor-1.0.3 spec/dsl_spec.rb
carrierwave-processor-1.0.2 spec/dsl_spec.rb