Differences for webmock on 1.8.7, 1.9.3, 2.0.0

35 views
Skip to first unread message

Peter M Souter

unread,
Sep 5, 2013, 5:25:20 AM9/5/13
to webmoc...@googlegroups.com
Hello All,

I'm having an issue with webmock on different versions of Ruby.

Here's my test code (it's for a dropbox CLI gem: https://github.com/petems/slipsquare/blob/master/spec/cli/verify_spec.rb)

It's stubbing all calls to dropbox api uri with a regex for the headers (as they dynamically generated by time submitted, so have to be regex)

I'm developing in a 2.0.0 environment and everything worked fine, but when I pushed to Travis, the tests fail on everything other than 2.0.0...

All the other versions are getting the Unregistered request which should be captured by the regex. I'm not sure if this is an issue with webmock, or the way that regex is handled in different versions of Ruby?

Any help would be appreciated!

Thanks

Regards

Bartosz Blimke

unread,
Sep 6, 2013, 4:36:39 AM9/6/13
to webmoc...@googlegroups.com
Hi Peter,


The stub declaration contains `'Accept-Encoding'=>'gzip;q=1.0,deflate;q=0.6,identity;q=0.3'` which I guess you copied from generated stub declaration by WebMock running Ruby 2.0? This header is only added by Ruby 2.0.0, so it's not expected in other Ruby versions. Please remove this header from stub declaration and it should be fine.

Bartosz


2013/9/5 Peter M Souter <p.mo...@gmail.com>

--
 
---
You received this message because you are subscribed to the Google Groups "webmock-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to webmock-user...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Peter M Souter

unread,
Sep 14, 2013, 9:29:47 AM9/14/13
to webmoc...@googlegroups.com
Hi Bartosz,

Yep, ended up with trial and error and figured that out in the end. Working great now! :)

Thanks

Regards
Reply all
Reply to author
Forward
0 new messages