File: caching_steps.rb

package info (click to toggle)
ruby-carrierwave 0.10.0%2Bgh-4
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 1,200 kB
  • ctags: 531
  • sloc: ruby: 7,180; sh: 26; makefile: 4
file content (14 lines) | stat: -rw-r--r-- 405 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
# encoding: utf-8

Given /^the file '(.*?)' is cached file at '(.*?)'$/ do |file, cached|
  FileUtils.mkdir_p(File.dirname(file_path(cached)))
  FileUtils.cp(file_path(file), file_path(cached))
end

When /^I cache the file '(.*?)'$/ do |file|
  @uploader.cache!(File.open(file_path(file)))
end

When /^I retrieve the cache name '(.*?)' from the cache$/ do |name|
  @uploader.retrieve_from_cache!(name)
end