Sha256: 3f8a37fee731f0d9ab652327357cb5a75de037701262921e842291f3561a44c1

Contents?: true

Size: 1.07 KB

Versions: 32

Compression:

Stored size: 1.07 KB

Contents

##############################################################################
#                             CarrierWave Plugin
##############################################################################

begin
  require 'carrierwave'
  require 'carrierwave/test/matchers'

  RSpec.configure do |config|
    config.include CarrierWave::Test::Matchers, :file_attachment => true
  end

  CarrierWave.configure do |config|
    config.storage           = :file
    config.root              = File.expand_path('./tmp')
    config.enable_processing = false
  end

  RSpec.configure do |config|
    config.around(:each, :file_attachment => true) do |example|
      previous_carrierwave_processing_mode = subject.class.enable_processing
      previous_carrierwave_storage_mode    = subject.class.storage

      subject.class.enable_processing = true
      subject.class.storage           = :file

      example.run

      subject.class.storage           = previous_carrierwave_storage_mode
      subject.class.enable_processing = previous_carrierwave_processing_mode
    end
  end
rescue LoadError
end

Version data entries

32 entries across 32 versions & 2 rubygems

Version Path
rspectacular-0.61.0 lib/rspectacular/plugins/carrier_wave.rb
rspectacular-0.60.0 lib/rspectacular/plugins/carrier_wave.rb
rspectacular-0.59.0 lib/rspectacular/plugins/carrier_wave.rb
rspectacular-0.58.0 lib/rspectacular/plugins/carrier_wave.rb
rspectacular-0.57.0 lib/rspectacular/plugins/carrier_wave.rb
rspectacular-0.56.0 lib/rspectacular/plugins/carrier_wave.rb
rspectacular-0.55.0 lib/rspectacular/plugins/carrier_wave.rb
rspectacular-0.54.0 lib/rspectacular/plugins/carrier_wave.rb
rspectacular-0.53.1 lib/rspectacular/plugins/carrier_wave.rb
rspectacular-0.53.0 lib/rspectacular/plugins/carrier_wave.rb
rspectacular-0.52.0 lib/rspectacular/plugins/carrier_wave.rb
rspectacular-0.51.0 lib/rspectacular/plugins/carrier_wave.rb