mirror of
https://github.com/Retrospring/retrospring.git
synced 2024-11-20 14:29:53 +01:00
9413d23a02
this also allows the UseCase classes to be hot reloaded in dev 🎉
- remove use_case requires (except for the exporter as Zeitwerk
doesn't know about the subclasses)
- move version.rb to lib/retrospring so that Zeitwerk knows where
to find Retrospring::Version
22 lines
825 B
Ruby
22 lines
825 B
Ruby
# frozen_string_literal: true
|
|
|
|
raise ArgumentError.new("This file should only be required in the 'test' environment! Current environment: #{Rails.env}") unless Rails.env.test?
|
|
|
|
# an example exporter to be used for the tests of `Exporter`
|
|
#
|
|
# this only returning basic files, nothing user-specific. each exporter should be tested individually.
|
|
class ExampleExporter < UseCase::DataExport::Base
|
|
def files = {
|
|
"textfile.txt" => "Sample Text\n",
|
|
"pictures/example.jpg" => File.read(File.expand_path("../fixtures/files/banana_racc.jpg", __dir__)),
|
|
"some.json" => json_file!(
|
|
animals: %w[raccoon fox hyena deer dog],
|
|
big_number: 3457812374589235798,
|
|
booleans: {
|
|
yes: true,
|
|
no: false,
|
|
file_not_found: nil
|
|
}
|
|
)
|
|
}
|
|
end
|