factory_bot icon indicating copy to clipboard operation
factory_bot copied to clipboard

Warnings are displayed when factory bot is used with Ruby 3.3.0

Open robinborst95 opened this issue 9 months ago • 2 comments

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

robinborst95 avatar May 08 '24 08:05 robinborst95

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

hamilton-keisuke avatar Jun 19 '24 06:06 hamilton-keisuke

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 avatar Jul 19 '24 10:07 sarahraqueld

@sarahraqueld I think you accidentally re-opened this issue ( which is resolved )

chaadow avatar Sep 08 '24 10:09 chaadow

Thanks, @chaadow :)

sarahraqueld avatar Sep 09 '24 08:09 sarahraqueld