Return-Path: X-Original-To: apmail-incubator-deltacloud-dev-archive@minotaur.apache.org Delivered-To: apmail-incubator-deltacloud-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 686D0729C for ; Wed, 9 Nov 2011 12:41:40 +0000 (UTC) Received: (qmail 10237 invoked by uid 500); 9 Nov 2011 12:41:40 -0000 Delivered-To: apmail-incubator-deltacloud-dev-archive@incubator.apache.org Received: (qmail 10222 invoked by uid 500); 9 Nov 2011 12:41:40 -0000 Mailing-List: contact deltacloud-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: deltacloud-dev@incubator.apache.org Delivered-To: mailing list deltacloud-dev@incubator.apache.org Received: (qmail 10214 invoked by uid 99); 9 Nov 2011 12:41:40 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 09 Nov 2011 12:41:40 +0000 X-ASF-Spam-Status: No, hits=-5.0 required=5.0 tests=RCVD_IN_DNSWL_HI,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of mfojtik@redhat.com designates 209.132.183.28 as permitted sender) Received: from [209.132.183.28] (HELO mx1.redhat.com) (209.132.183.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 09 Nov 2011 12:41:34 +0000 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id pA9CfCS2005777 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 9 Nov 2011 07:41:12 -0500 Received: from dhcp-29-121.brq.redhat.com (dhcp-29-121.brq.redhat.com [10.34.29.121]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id pA9CfBG6029461; Wed, 9 Nov 2011 07:41:12 -0500 Message-ID: <4EBA751C.2070903@redhat.com> Date: Wed, 09 Nov 2011 13:42:04 +0100 From: Michal Fojtik User-Agent: Postbox 3.0.0 (Macintosh/20111031) MIME-Version: 1.0 To: deltacloud-dev@incubator.apache.org Subject: Re: [PATCH 3/3] Monkey patch fix for VCR normalisation code References: <1320764680-24745-1-git-send-email-marios@redhat.com> <1320764680-24745-4-git-send-email-marios@redhat.com> In-Reply-To: <1320764680-24745-4-git-send-email-marios@redhat.com> X-Enigmail-Version: 1.2 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 X-Virus-Checked: Checked by ClamAV on apache.org -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi, Finished in 4.764091 seconds. 13 tests, 0 assertions, 0 failures, 0 errors ACK! :-) -- Michal marios@redhat.com wrote: > From: marios > > Needed in order to run google unit tests - see > https://github.com/myronmarston/vcr/issues/101 > > Signed-off-by: marios --- > server/tests/drivers/google/setup.rb | 25 > +++++++++++++++++++++++++ 1 files changed, 25 insertions(+), 0 > deletions(-) > > diff --git a/server/tests/drivers/google/setup.rb > b/server/tests/drivers/google/setup.rb index 09aea62..95924e5 100644 > --- a/server/tests/drivers/google/setup.rb +++ > b/server/tests/drivers/google/setup.rb @@ -11,3 +11,28 @@ 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) +# +#RELEVANT: > https://github.com/myronmarston/vcr/issues/101 +#(will need > revisiting when vcr 2 comes along) + +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 - -- - -- Michal Fojtik, mfojtik@redhat.com Deltacloud API: http://deltacloud.org -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQEcBAEBAgAGBQJOunUcAAoJEEnFpmY+LvFR05QH/Ry7jZdYnb9qSovv6t0yQLCY /MM2NVzyfUrgvbsxjpNsihB7Q4yqRoNKnrQ4Ip6Zjy0+dGghwg4MKqXoQSjCZXqc i1T9ncoiw6xjbkYvTnaUT6YqUxLcFGuheJpB5948GDDR1ADzCpAQQHjC90xfDoIn R88/B2F0GBHHeoxNWkNVLd+ejk3MMwsLjBuWEtX0s9HwiXKa/SOxLkaJGaLSjLk2 8NErle4LkssPaPuY3mde+LR90kjkUUxn3nOA651Y+iCcf5TYh8b+kBcB5DEKgqKZ zg1WiixtNYG9+3JwCNwaPgbtNoK6FdXWcRScjxmRUP/evhOQwjjHUx9EkUPYDs8= =LNQX -----END PGP SIGNATURE-----