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.
Description
Syntax error in factory_bot gem files when using Ruby 2.7.0.
Reproduction Steps
factory_bot_rails
gem to the Gemfile.bundle install
.FactoryBot
.rspec
.Expected Behavior
The test should run without errors.
Actual Behavior
A syntax error occurs in
factory_bot
gem files, such asevaluator.rb
anddefinition_proxy.rb
, preventing the test from running. The error message points to lines of code using themethod_missing
andsequence
methods.1. File :
evaluator.rb
Correction:
Add the
*args
and&block
parameters to themethod_missing
method definition2. File :
definition_proxy.rb
Correction:
The
method_missing
method definition is already correct. Change thesequence
method definition to:3. File :
default.rb
Correction:
Change the
sequence
method definition to::The corrections involve adding the parameters
*args
and&block
to themethod_missing
andsequence
methods to ensure compatibility with Ruby 2.7.0 syntax.System Configuration