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

Version Path
togostanza-2.2.2 spec/lib/togostanza/stanza/grouping_spec.rb
togostanza-2.2.1 spec/lib/togostanza/stanza/grouping_spec.rb
togostanza-2.2.0 spec/lib/togostanza/stanza/grouping_spec.rb
togostanza-2.1.3 spec/lib/togostanza/stanza/grouping_spec.rb
togostanza-2.1.2 spec/lib/togostanza/stanza/grouping_spec.rb
togostanza-2.1.1 spec/lib/togostanza/stanza/grouping_spec.rb
togostanza-2.1.0 spec/lib/togostanza/stanza/grouping_spec.rb
togostanza-2.0.0 spec/lib/togostanza/stanza/grouping_spec.rb
togostanza-1.5.0 spec/lib/togostanza/stanza/grouping_spec.rb
togostanza-1.4.1 spec/lib/togostanza/stanza/grouping_spec.rb
togostanza-1.4.0 spec/lib/togostanza/stanza/grouping_spec.rb
togostanza-1.3.3 spec/lib/togostanza/stanza/grouping_spec.rb
togostanza-1.3.2 spec/lib/togostanza/stanza/grouping_spec.rb
togostanza-1.3.1 spec/lib/togostanza/stanza/grouping_spec.rb
togostanza-1.3.0 spec/lib/togostanza/stanza/grouping_spec.rb
togostanza-1.2.2 spec/lib/togostanza/stanza/grouping_spec.rb
togostanza-1.2.1 spec/lib/togostanza/stanza/grouping_spec.rb
togostanza-1.2.0 spec/lib/togostanza/stanza/grouping_spec.rb
togostanza-1.1.0 spec/lib/togostanza/stanza/grouping_spec.rb
togostanza-1.0.6 spec/lib/togostanza/stanza/grouping_spec.rb