fake-file is a Ruby gem that generates temporary fake files (PDF, DOCX, XLSX) for testing purposes. It eliminates the need to store fixture files in test directories when testing file attachments with ActiveStorage, Shrine, or CarrierWave. The gem provides simple facade methods, a generic generator, and Rack::Test integration for request specs. It's extensible through a registry system that allows adding new file format generators.

2m read timeFrom github.com
Post cover image
Table of contents
InstallationQuick StartAPIUsage in testsAdding a new formatDevelopmentContributingLicense
110 Impressions