Closes#1336
* removes all the deprecated methods
* removes Ruby 2.3, 2.4 and Rails 4.2 from travis
* bundle updates the test gemfiles
* Removes some pre-5.0 logic from a test helper
* Targets Ruby 2.5 with rubocop and fixes violations
We could also remove support for Rails 5.0 and 5.1, which are now EOL,
but I don't see a strong reason to do that. We don't seem to have to do
anything special to support those versions.
In this PR the cop Style/MethodMissing was split into
Style/MethodMissingSuper and Style/MissingRespondToMissing.
https://github.com/rubocop-hq/rubocop/pull/5811
This commit goes through the disables and updates them to reflect the
appropriate new Cops.
In 241e8e5fb4, this call to `undef_method`
was introduced to suppress the warning printed by Ruby when a method is
redefined.
That warning is only printed when the method is already defined on the
class in question; it isn't printed when the method was inherited from
an ancestor, since overriding methods by shadowing them is a feature.
However, `method_defined?` returns true for inherited methods, which
means we're sometimes undefining methods that wouldn't cause a warning.
If a factory defines an attribute named `object_id` (admittedly not a
great idea), we will undefine the `object_id` method inherited from the
`Object` class, and the following warning will be printed:
factory_bot/evaluator.rb:70: warning: undefining `object_id' may cause serious problems
By only undefining the method if it's defined on the current class, we
can avoid undefining inherited methods and triggering this warning.
To make it obvious that these are non-standard cases.
Also add respond_to_missing? to the decorator.
We are using Style/MethodMissing rather than
Style/MethodMissingSuper and Style/MissingRespondToMissing because we
are still on RuboCop 0.54.