Skip to content

Default Redis database always included #17

Open
@karlhe

Description

@karlhe

I have DatabaseCleaner configured with multiple Redis databases, something like the following:.

DatabaseCleaner[:redis, db: Redis.new(url: "rediss://localhost:6379/1", ssl_params: { verify_mode: OpenSSL::SSL::VERIFY_NONE })].strategy = :deletion
DatabaseCleaner[:redis, db: Redis.new(url: "rediss://localhost:6379/2", ssl_params: { verify_mode: OpenSSL::SSL::VERIFY_NONE })].strategy = :deletion
DatabaseCleaner[:redis, db: Redis.new(url: "rediss://localhost:6379/3", ssl_params: { verify_mode: OpenSSL::SSL::VERIFY_NONE })].strategy = :deletion
DatabaseCleaner[:redis, db: Redis.new(url: "rediss://localhost:6379/4", ssl_params: { verify_mode: OpenSSL::SSL::VERIFY_NONE })].strategy = :deletion

The problem is that it still cleans the default Redis database despite me configuring it.

As a workaround, doing the following seems to remove this behavior:

DatabaseCleaner[:redis].strategy = nil

But I think it doesn't make sense to do this if any other Redis cleaner is configured. Or at least this behavior should be documented if intentional.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions