Using plugin :uppy_s3_multipart in a test suite

Hi all

was wondering how you folks use the multi-part plugin while running tests:

shrine initialiser

case Rails.env
when “test”
require “shrine/storage/memory”

Shrine.storages = {
cache: Shrine::Storage::Memory.new(prefix: “cache”),
store: Shrine::Storage::Memory.new(prefix: “uploads”),
}
end
Shrine.plugin :uppy_s3_multipart

But this is set to explicitly fail in the tests: https://github.com/janko/uppy-s3_multipart/blob/33c7780d7e90fb014fe375317cba11983f3943d9/test/shrine_test.rb#L95

Was wondering how to include the uppy_s3_multipart plugin AND have all the tests pass while using Shrine::Storage::Memory?

Any advice would be much appreciated.

You could use aws-sdk-s3 stubs, examples of which you can see in client_test.rb or in Shrine’s s3_test.rb.

1 Like