Skip to content
This repository

RuntimeError string frozen #107

Closed
visoft opened this Issue · 6 comments

3 participants

Damien White Clif Reeder Bob Aman
Damien White

I use webmock (v1.8.11) to test my project ruby_odata. When I deployed a README change today, Travis.ci bombed out with an error when testing it on Ruby 1.8.7 (1.9.2 and 1.9.3 are fine). Looking at the gems that were installed, I see that addressable 2.3.3 was being used. v2.3.2 was working fine. You can see the details on Travis. The error is:

OData::Service handling partial collections should return the whole collection by default
    Failure/Error: stub_request(:get, "http://test.com/test.svc/Partials?$skiptoken='ERNSH'").
    RuntimeError:
       string frozen
   # ./spec/service_spec.rb:352

I am stubbing the same URL a couple of times with different querystring parameters.

Clif Reeder

I ran into this problem as well. Downgrading to v2.3.2 fix it.

1) Error:
....
ActionView::TemplateError: string frozen
....    
addressable (2.3.3) lib/addressable/uri.rb:366:in `gsub!'
addressable (2.3.3) lib/addressable/uri.rb:366:in `encode_component'
webmock (1.9.0) lib/webmock/util/query_mapper.rb:180:in `values_to_query'
webmock (1.9.0) lib/webmock/util/query_mapper.rb:179:in `each'
webmock (1.9.0) lib/webmock/util/query_mapper.rb:179:in `values_to_query'
Bob Aman
Owner

My intense dislike of freezing stuff continues.

Bob Aman
Owner

Maybe just change gsub! to gsub and reassign?

Bob Aman
Owner

Trying checkout out master and seeing if this issue is now resolved. I'll push a new release if it is. I systematically went through the entire codebase, and removed every gsub! that wasn't preceeded by a dup or some other method call that would return a copy of the string instead of the original which might be frozen.

Damien White
visoft commented

The 2.3.4 version fixes this issue, thanks!

Damien White visoft closed this
Bob Aman
Owner

Excellent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.