Skip to content

Deprecation warning in Ruby 3.4: "string returned by :…to_s will be frozen in the future" in RSpec::Mocks::InstanceMethodStasher #227

Open
@thomaswitt

Description

@thomaswitt

What’s happening?

I enabled Warning[:deprecated] = true in my spec/spec_helper.rb.

Running specs on Ruby 3.4.4 with RSpec 3.13.5 shows on my console warnings like

/Users/thomas/.rbenv/versions/3.4.4/lib/ruby/gems/3.4.0/gems/rspec-mocks-3.13.5/lib/rspec/mocks/instance_method_stasher.rb:8: warning: string returned by :id.to_s will be frozen in the future

I guess it has to do with "stashed_method_name", but a simple .dup doesnt solve the problem.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions