Restore compatibility with database_cleaner < 1.8.0.beta #473
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
DatabaseCleaner::VERSION
didn't exist until1.8.0.beta
, so having an older version causes an uninitialized constant error instead of using the old behavior.Details
When upgrading the cucumber-rails 2.1, my @javascript scenarios failed with
uninitialized constant DatabaseCleaner::VERSION (NameError)
errors. cucumber-rails has conditional logic checking ifDatabaseCleaner::VERSION
is greater than or equal to1.8.0.beta
, butDatabaseCleaner::VERSION
didn't exist until1.8.0.beta
.Motivation and Context
The code change that added support for newer versions of Database Cleaner was written with the intention of maintaining support for older versions of Database Cleaner, but it failed in practice. This change restores compatibility with older versions.
How Has This Been Tested?
I tested with my app still using Database Cleaner 1.7.0. It failed when using the release version of cucumber-rails 2.1, but succeeded using the versions of cucumber-rails in this pull request.
I did not add an automated test because, outside of Rails itself, the project doesn't seem to take on the overhead of testing with older versions of libraries and an automated test for backwards compatibility wasn't added with the original change. If I'm wrong in that assessment, I'm happy to add an automated test however the project would like.
Types of changes
Checklist: