Sha256: 56ccb8f8149ca13e1e8f2d3575bfc24ec9d42e0a6ab1f83eb74652351c244c0c

Contents?: true

Size: 367 Bytes

Versions: 4

Compression:

Stored size: 367 Bytes

Contents

module TempCacheDir
  def temp_dir(dir, options = {})
    before(:each) do
      @temp_dir = dir
      @dir_remover = lambda { FileUtils.rm_rf(@temp_dir) if File.exist?(@temp_dir) }
      @dir_remover.call
      if options[:assign_to_cache_dir]
        VCR::Config.cache_dir = @temp_dir
      end
    end

    after(:each) do
      @dir_remover.call
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
vcr-0.2.0 spec/support/temp_cache_dir.rb
vcr-0.1.2 spec/support/temp_cache_dir.rb
vcr-0.1.1 spec/support/temp_cache_dir.rb
vcr-0.1.0 spec/support/temp_cache_dir.rb