Sha256: 2d31e56302f45aa3cbf0c122935313225162c47f9e5ac439fb60e09385f761a8

Contents?: true

Size: 1.1 KB

Versions: 24

Compression:

Stored size: 1.1 KB

Contents

# frozen_string_literal: true

##############################################################################
#                             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

24 entries across 24 versions & 1 rubygems

Version Path
rspeckled-0.0.54 lib/rspeckled/plugins/carrier_wave.rb
rspeckled-0.0.53 lib/rspeckled/plugins/carrier_wave.rb
rspeckled-0.0.52 lib/rspeckled/plugins/carrier_wave.rb
rspeckled-0.0.51 lib/rspeckled/plugins/carrier_wave.rb
rspeckled-0.0.50 lib/rspeckled/plugins/carrier_wave.rb
rspeckled-0.0.49 lib/rspeckled/plugins/carrier_wave.rb
rspeckled-0.0.48 lib/rspeckled/plugins/carrier_wave.rb
rspeckled-0.0.47 lib/rspeckled/plugins/carrier_wave.rb
rspeckled-0.0.46 lib/rspeckled/plugins/carrier_wave.rb
rspeckled-0.0.45 lib/rspeckled/plugins/carrier_wave.rb
rspeckled-0.0.44 lib/rspeckled/plugins/carrier_wave.rb
rspeckled-0.0.43 lib/rspeckled/plugins/carrier_wave.rb
rspeckled-0.0.42 lib/rspeckled/plugins/carrier_wave.rb
rspeckled-0.0.41 lib/rspeckled/plugins/carrier_wave.rb
rspeckled-0.0.40 lib/rspeckled/plugins/carrier_wave.rb
rspeckled-0.0.39 lib/rspeckled/plugins/carrier_wave.rb
rspeckled-0.0.38 lib/rspeckled/plugins/carrier_wave.rb
rspeckled-0.0.37 lib/rspeckled/plugins/carrier_wave.rb
rspeckled-0.0.36 lib/rspeckled/plugins/carrier_wave.rb
rspeckled-0.0.35 lib/rspeckled/plugins/carrier_wave.rb