incubator-deltacloud-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "marios@redhat.com" <mandr...@redhat.com>
Subject Re: [PATCH core 1/4] CIMI: Added helper methods to check serialization and inconsistencies between JSON and XML
Date Thu, 17 Nov 2011 10:46:55 GMT
ACK

On 16/11/11 22:34, mfojtik@redhat.com wrote:
> From: Michal Fojtik <mfojtik@redhat.com>
> 
> ---
>  server/spec/spec_helper.rb |   10 ++++++++++
>  1 files changed, 10 insertions(+), 0 deletions(-)
> 
> diff --git a/server/spec/spec_helper.rb b/server/spec/spec_helper.rb
> index d046260..c8b41fc 100644
> --- a/server/spec/spec_helper.rb
> +++ b/server/spec/spec_helper.rb
> @@ -90,6 +90,16 @@ class HashCmp
>    end
>  end
>  
> +def should_serialize_from_xml!(model, xml, json)
> +  model.to_xml.should serialize_to xml, :fmt => :xml
> +  model.to_json.should serialize_to json, :fmt => :json
> +end
> +
> +def should_serialize_from_json!(model, xml, json)
> +  model.to_xml.should serialize_to xml, :fmt => :xml
> +  model.to_json.should serialize_to json, :fmt => :json
> +end
> +
>  RSpec::Matchers.define :serialize_to do |exp, opts|
>    match do |act|
>      matcher(exp, act, opts[:fmt]).match?


Mime
View raw message