Sha256: 02c3c13e997231eca98185e379d1f56778014d7e857e230c7af61d785a896792
Contents?: true
Size: 797 Bytes
Versions: 31
Compression:
Stored size: 797 Bytes
Contents
require 'spec_helper' describe TogoStanza::Stanza::Grouping do specify do data = [ {cpd1: 'cpd1-1', cpd2: 'cpd2-1', ec: 'ec-1', gene: 'gene-1'}, {cpd1: 'cpd1-1', cpd2: 'cpd2-1', ec: 'ec-1', gene: 'gene-2'}, {cpd1: 'cpd1-1', cpd2: 'cpd2-1', ec: 'ec-2', gene: 'gene-3'}, {cpd1: 'cpd1-2', cpd2: 'cpd2-2', ec: 'ec-3', gene: 'gene-4'} ] TogoStanza::Stanza::Grouping.grouping(data, {[:cpd1, :cpd2] => :cpd}, :ec, :gene).should == [ { :cpd => ["cpd1-1", "cpd2-1"], :ec => [ {:ec => "ec-1", :gene => ["gene-1", "gene-2"]}, {:ec => "ec-2", :gene => ["gene-3"]} ] }, { :cpd => ["cpd1-2", "cpd2-2"], :ec => [ {:ec => "ec-3", :gene => ["gene-4"]} ] } ] end end
Version data entries
31 entries across 31 versions & 1 rubygems