RuntimeError string frozen #107

Closed
visoft opened this Issue Feb 22, 2013 · 6 comments

Comments

Projects
None yet
3 participants
@visoft

visoft commented Feb 22, 2013

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.

@clifff

This comment has been minimized.

Show comment Hide comment
@clifff

clifff Feb 26, 2013

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'

clifff commented Feb 26, 2013

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'
@sporkmonger

This comment has been minimized.

Show comment Hide comment
@sporkmonger

sporkmonger Feb 26, 2013

Owner

My intense dislike of freezing stuff continues.

Owner

sporkmonger commented Feb 26, 2013

My intense dislike of freezing stuff continues.

@sporkmonger

This comment has been minimized.

Show comment Hide comment
@sporkmonger

sporkmonger Feb 28, 2013

Owner

Maybe just change gsub! to gsub and reassign?

Owner

sporkmonger commented Feb 28, 2013

Maybe just change gsub! to gsub and reassign?

@sporkmonger

This comment has been minimized.

Show comment Hide comment
@sporkmonger

sporkmonger Mar 31, 2013

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.

Owner

sporkmonger commented Mar 31, 2013

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.

@visoft

This comment has been minimized.

Show comment Hide comment
@visoft

visoft May 24, 2013

The 2.3.4 version fixes this issue, thanks!

visoft commented May 24, 2013

The 2.3.4 version fixes this issue, thanks!

@visoft visoft closed this May 24, 2013

@sporkmonger

This comment has been minimized.

Show comment Hide comment
@sporkmonger

sporkmonger May 24, 2013

Owner

Excellent.

Owner

sporkmonger commented May 24, 2013

Excellent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment