Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

teach #inspect how to build string without appending to a frozen string #995

Merged
merged 2 commits into from
Jul 8, 2019

Conversation

technoweenie
Copy link
Member

The Rubocop effort included (#868) taking advantage of an optimization that makes all string literals immutable. However, it turns out we don't test #inspect on the Faraday::Options types.

You can trigger this bug easily with the current master branch:

irb(main):003:0> Faraday.get "http://example.com"
Traceback (most recent call last):
        5: from /Users/rick/.rbenv/versions/2.5.3/bin/irb:11:in `<main>'
        4: from /Users/rick/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/faraday-1.0.0.pre.rc1/lib/faraday/options/env.rb:151:in `inspect'
        3: from /Users/rick/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/faraday-1.0.0.pre.rc1/lib/faraday/options/env.rb:151:in `each'
        2: from /Users/rick/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/faraday-1.0.0.pre.rc1/lib/faraday/options/env.rb:153:in `block in inspect'
        1: from /Users/rick/.rbenv/versions/2.5.3/lib/ruby/gems/2.5.0/gems/faraday-1.0.0.pre.rc1/lib/faraday/options.rb:154:in `inspect'
FrozenError (can't modify frozen String)

@iMacTia iMacTia requested review from iMacTia and olleolleolle July 8, 2019 17:56
@technoweenie technoweenie merged commit 8585604 into master Jul 8, 2019
@technoweenie technoweenie deleted the fix-options-inspect branch July 8, 2019 18:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants