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.34 lib/rspeckled/plugins/carrier_wave.rb
rspeckled-0.0.33 lib/rspeckled/plugins/carrier_wave.rb
rspeckled-0.0.32 lib/rspeckled/plugins/carrier_wave.rb
rspeckled-0.0.31 lib/rspeckled/plugins/carrier_wave.rb