fakeweb
fakeweb copied to clipboard
Compatibility Issue with Ruby 2.4?
I installed fakeweb (1.3.0) in Ruby 2.4.1 and Rails 5.1.4 and when tried to use it I started to get a this error.
Failure/Error: Net::HTTP.get(url)
NoMethodError: undefined method `<<' for {:read_timeout=>60, :continue_timeout=>nil, :debug_output=>nil}:Hash
And this one, whenever I tried to make and HTTP call using Net::HTTP.
Failure/Error: puts Net::HTTP.get(@uri)
NoMethodError: undefined method `close' for #<FakeWeb::StubSocket:0x007fc72ea8f230>
I searched the web and found that many other testing frameworks are affected by this compatibility issue and after reading many posts for WebMock and VCR, I finally came across a solution. It suggested doing this and oddly enough it worked.
gem 'fakeweb', :git => 'https://github.com/chrisk/fakeweb.git'
Is it time to make a new gem release? Why does this work around actually work but the release gem fails?
I hope this helps.
There hasn't been a release for many years since the author has been ill. Hopefully there will be one soon. See: https://github.com/chrisk/fakeweb/issues/57
The simple answer is that the git master is ahead of the last release (judging by the git release tag v1.3.0). See https://github.com/chrisk/fakeweb/compare/v1.3.0...master