Skip to content
This repository was archived by the owner on Nov 30, 2024. It is now read-only.

rspec testsuite error with ruby3.4.0dev #3123

Closed
mtasaka opened this issue Nov 15, 2024 · 2 comments · Fixed by #3124
Closed

rspec testsuite error with ruby3.4.0dev #3123

mtasaka opened this issue Nov 15, 2024 · 2 comments · Fixed by #3124

Comments

@mtasaka
Copy link

mtasaka commented Nov 15, 2024

With using ruby3.4.0dev ( ruby 3.4.0dev (2024-11-15 master 51666c827b) +PRISM [x86_64-linux] ),
executing rspec-core 3.13.2 rspec testsuite causes errors like:

Failures:

  1) RSpec::Core::DRbOptions DRB args with tags leaves inclusion tags with values intact
     Failure/Error: @example_group_instance.instance_exec(*args, &block)

     RuntimeError:
       Warnings were generated: /builddir/build/BUILD/rubygem-rspec-core-3.13.2-build/rspec-core-3.13.2/lib/rspec/core/drb.rb:95: warning: warning: string returned by :tag.to_s will be frozen in the future
     # ./spec/spec_helper.rb:57:in 'CommonHelpers#without_env_vars'
     # ./spec/support/config_options_helper.rb:4:in 'block in <module:ConfigOptionsHelper>'
     # ./spec/support/isolated_home_directory.rb:13:in 'block (5 levels) in <top (required)>'
     # ./spec/spec_helper.rb:46:in 'CommonHelpers#with_env_vars'
     # ./spec/support/isolated_home_directory.rb:12:in 'block (4 levels) in <top (required)>'
     # ./spec/spec_helper.rb:57:in 'CommonHelpers#without_env_vars'
     # ./spec/support/isolated_home_directory.rb:11:in 'block (3 levels) in <top (required)>'
     # ./spec/support/isolated_home_directory.rb:7:in 'block (2 levels) in <top (required)>'
     # ./spec/spec_helper.rb:65:in 'CommonHelpers#handle_current_dir_change'
     # ./spec/spec_helper.rb:75:in 'block (2 levels) in <top (required)>'
     # ./spec/support/sandboxing.rb:16:in 'block (3 levels) in <top (required)>'
     # ./spec/support/sandboxing.rb:7:in 'block (2 levels) in <top (required)>'

  2) RSpec::Core::DRbOptions DRB args with tags includes the inclusion tags with values
     Failure/Error: @example_group_instance.instance_exec(*args, &block)

     RuntimeError:
       Warnings were generated: /builddir/build/BUILD/rubygem-rspec-core-3.13.2-build/rspec-core-3.13.2/lib/rspec/core/drb.rb:95: warning: warning: string returned by :tag.to_s will be frozen in the future
     # ./spec/spec_helper.rb:57:in 'CommonHelpers#without_env_vars'
     # ./spec/support/config_options_helper.rb:4:in 'block in <module:ConfigOptionsHelper>'
     # ./spec/support/isolated_home_directory.rb:13:in 'block (5 levels) in <top (required)>'
     # ./spec/spec_helper.rb:46:in 'CommonHelpers#with_env_vars'
     # ./spec/support/isolated_home_directory.rb:12:in 'block (4 levels) in <top (required)>'
     # ./spec/spec_helper.rb:57:in 'CommonHelpers#without_env_vars'
     # ./spec/support/isolated_home_directory.rb:11:in 'block (3 levels) in <top (required)>'
     # ./spec/support/isolated_home_directory.rb:7:in 'block (2 levels) in <top (required)>'
     # ./spec/spec_helper.rb:65:in 'CommonHelpers#handle_current_dir_change'
     # ./spec/spec_helper.rb:75:in 'block (2 levels) in <top (required)>'
     # ./spec/support/sandboxing.rb:16:in 'block (3 levels) in <top (required)>'
     # ./spec/support/sandboxing.rb:7:in 'block (2 levels) in <top (required)>'

Finished in 7.94 seconds (files took 0.44011 seconds to load)
2234 examples, 2 failures, 6 pending

This is probably due to ruby/ruby@6deeec5

@mtasaka
Copy link
Author

mtasaka commented Nov 17, 2024

simple workaround:

diff -urp -x examples.txt '--exclude=*~' rspec-core-3.13.2.orig/lib/rspec/core/drb.rb rspec-core-3.13.2/lib/rspec/core/drb.rb
--- rspec-core-3.13.2.orig/lib/rspec/core/drb.rb	2024-10-21 14:23:30.000000000 +0900
+++ rspec-core-3.13.2/lib/rspec/core/drb.rb	2024-11-15 14:48:52.388539773 +0900
@@ -91,7 +91,7 @@ module RSpec
       def add_filter(argv, name, hash)
         hash.each_pair do |k, v|
           next if CONDITIONAL_FILTERS.include?(k)
-          tag = name == :inclusion ? k.to_s : "~#{k}".dup
+          tag = name == :inclusion ? k.to_s.dup : "~#{k}".dup
           tag << ":#{v}" if v.is_a?(String)
           argv << "--tag" << tag
         end unless hash.empty?

@JonRowe
Copy link
Member

JonRowe commented Nov 17, 2024

I've been waiting for github actions to catch up because it doesn't occur in preview2 and ruby-head won't install on my Mac atm

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants