From: "yahonda (Yasuo Honda)" Date: 2021-09-19T00:16:17+00:00 Subject: [ruby-core:105345] [Ruby master Bug#18177] An error occurs when running RSpec with Ruby 3.1.0-dev Issue #18177 has been updated by yahonda (Yasuo Honda). Rails CI against Ruby master is also affected by this commit. https://github.com/ruby/ruby/pull/4858/commits/178ee1e801acb33d13b3e8a630f6ca4926c68fbc - CI failure https://buildkite.com/rails/rails/builds/81084#67d95e32-91b9-49c2-a463-3499e25d2660/1110-1113 - Argument Error raised at this line https://github.com/rails/rails/blob/c839fdb4d715e0866bb4e483283e7e3e60e5bfe1/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb#L689 ---------------------------------------- Bug #18177: An error occurs when running RSpec with Ruby 3.1.0-dev https://bugs.ruby-lang.org/issues/18177#change-93760 * Author: koic (Koichi ITO) * Status: Open * Priority: Normal * ruby -v: ruby 3.1.0dev (2021-09-17T11:46:18Z master b45fe48fbb) [x86_64-darwin19] * Backport: 2.6: UNKNOWN, 2.7: UNKNOWN, 3.0: UNKNOWN ---------------------------------------- ## Reproduction context The following code causes an `ArgumentError` error when using Ruby 3.1.0-dev. ```ruby # foo_spec.rb RSpec.shared_context 'config', :config do end RSpec.describe 'foo', :config do end ``` RSpec version is as follows. ```console % gem i rspec % rspec -v RSpec 3.10 - rspec-core 3.10.1 - rspec-expectations 3.10.1 - rspec-mocks 3.10.2 - rspec-rails 5.0.1 - rspec-support 3.10.2 ``` ## Expected Behavior (Ruby 3.0.2) No errors. ```console % ruby -v ruby 3.0.2p107 (2021-07-07 revision 0db68f0233) [x86_64-darwin19] ``` ```console % rspec foo_spec.rb No examples found. Finished in 0.00023 seconds (files took 0.11432 seconds to load) 0 examples, 0 failures ``` ## Actual Behavior (Ruby 3.1.0-dev) `ArgumentError: uninitialized module` exception is raised. ```console % ruby -v ruby 3.1.0dev (2021-09-17T11:46:18Z master b45fe48fbb) [x86_64-darwin19] ``` ```console % rspec foo_spec.rb An error occurred while loading ./foo_spec.rb. Failure/Error: host.__send__(:include, mod) unless host < mod ArgumentError: uninitialized module # ./foo_spec.rb:5:in `' No examples found. Finished in 0.00003 seconds (files took 0.18197 seconds to load) 0 examples, 0 failures, 1 error occurred outside of examples ``` Perhaps the following commits have changed the behavior. https://github.com/ruby/ruby/commit/178ee1e#diff-ddea6b44375166521cc45b79d4c54b08594c13872acc5ec279f07d2eda8c32baR920 I encountered this error in the following build error of RuboCop Rails. https://app.circleci.com/pipelines/github/rubocop/rubocop-rails/1323/workflows/5a4fc5af-448c-46d7-a723-ee1c119fc2f2/jobs/8579 I opened this issue because I'm not sure what an expected behavior is. Thank you. -- https://bugs.ruby-lang.org/ Unsubscribe: