Detect incompatible use of `Struct.new` in specs
This commit patches `Struct.new` in specs when `keyword_init` is missing and a Hash passed. Reason: Since Ruby 3.2 `Struct` supports kwargs by default so `keyword_init: true` is no longer required. We are running Ruby 3.2 in MRs and Ruby 3.1 on master so occasionally master is broken due to this incompatibility. This slows down creation of Struct objects in specs by factor 3.
显示
- lib/gitlab/ci/pipeline/chain/command.rb 2 个添加, 7 个删除lib/gitlab/ci/pipeline/chain/command.rb
- spec/lib/gitlab/relative_positioning/range_spec.rb 1 个添加, 1 个删除spec/lib/gitlab/relative_positioning/range_spec.rb
- spec/spec_helper.rb 2 个添加, 0 个删除spec/spec_helper.rb
- spec/support/rspec.rb 1 个添加, 0 个删除spec/support/rspec.rb
- spec/support/struct_with_kwargs.rb 38 个添加, 0 个删除spec/support/struct_with_kwargs.rb
- spec/support_specs/struct_with_kwargs_spec.rb 82 个添加, 0 个删除spec/support_specs/struct_with_kwargs_spec.rb
加载中
想要评论请 注册 或 登录