factory_bot
factory_bot copied to clipboard
Warnings are displayed when factory bot is used with Ruby 3.3.0
Description
Running code that uses the factory bot gem with Ruby 3.3.0 causes the following warnings to be shown:
warning: /opt/hostedtoolcache/Ruby/3.3.1/x64/lib/ruby/3.3.0/observer.rb was loaded from the standard library, but will no longer be part of the default gems since Ruby 3.4.0. Add observer to your Gemfile or gemspec. Also contact author of factory_bot-6.2.1 to add observer into its gemspec.
This is a deprecation warning that has been added to Ruby 3.3.0 and which will cause factory bot to fail if run with Ruby 3.4. See https://rubyreferences.github.io/rubychanges/3.3.html#gems-that-are-warned-to-become-bundled-in-the-next-version
Reproduction Steps
Run any code that uses this gem with Ruby 3.3.0 and you'll get this warning.
Expected behavior
This gem defines observer
as a dependency in its gemspec.
Actual behavior
observer
is not yet defined in its gemspec.
System configuration
factory_bot version: 6.2.1 ruby version: 3.3.0
I think this warning has been resolved in 6.4.4 or later.
cf.
- https://github.com/thoughtbot/factory_bot/releases/tag/v6.4.4
- https://github.com/thoughtbot/factory_bot/pull/1611
Hi @robinborst95, it seems like this issue has been fixed already, do you need support with anything else here? I'll close this issue otherwise :)
@sarahraqueld I think you accidentally re-opened this issue ( which is resolved )
Thanks, @chaadow :)