-
Notifications
You must be signed in to change notification settings - Fork 36
Allow read-only methods to work against a frozen StringIO #122
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
base: master
Are you sure you want to change the base?
Conversation
seek only modifies the StringIO pos, and should work when the underlying String is frozen. Fixes ruby#119
This fixes the JRuby extension to allow read-only methods to work against a frozen StringIO, as described in ruby#119.
It would make sense to me that |
|
See also: https://bugs.ruby-lang.org/issues/21151 |
This isn't really the use case here. What I'm seeking is a way to freeze a There's no reason I can think of that accessing current |
| f.freeze | ||
| assert_nothing_raised do | ||
| f2 = f.dup | ||
| assert_true(f2.frozen?) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Usually dupped objects are not frozen.
Add tests and fix behavior to allow several read-only StringIO methods to function when the StringIO is frozen.
See #120 for details.