method
new
v1.1.6 -
Show latest stable
- Class:
ActionController::TestUploadedFile
new(path, content_type = 'text/plain')public
No documentation available.
# File actionpack/lib/action_controller/test_process.rb, line 311
def initialize(path, content_type = 'text/plain')
raise "file does not exist" unless File.exist?(path)
@content_type = content_type
@original_filename = path.sub(/^.*#{File::SEPARATOR}([^#{File::SEPARATOR}]+)$/) { $1 }
@tempfile = Tempfile.new(@original_filename)
FileUtils.copy_file(path, @tempfile.path)
end