From: marios <mar...@redhat.com>
Signed-off-by: marios <mar...@redhat.com> --- server/tests/drivers/google/setup.rb | 22 ++++++++++++++++++++++ 1 files changed, 22 insertions(+), 0 deletions(-) diff --git a/server/tests/drivers/google/setup.rb b/server/tests/drivers/google/setup.rb index ac6bacd..abb48da 100644 --- a/server/tests/drivers/google/setup.rb +++ b/server/tests/drivers/google/setup.rb @@ -11,3 +11,25 @@ VCR.config do |c| c.stub_with :excon c.default_cassette_options = { :record => :new_episodes} end + +#monkey patch fix for VCR normalisation code: +#see https://github.com/myronmarston/vcr/issues/4 +#when body is a tempfile, like when creating new blob +#this method of normalisation fails and excon throws errors +#(Excon::Errors::SocketError:can't convert Tempfile into String) + +module VCR + module Normalizers + module Body + + private + def normalize_body + self.body = case body + when nil, ''; nil + else + String.new(body) unless body.is_a?(Tempfile) + end + end + end + end +end -- 1.7.6.4