Sha256: ca8e073d988509f173287f74c71b8d11d5712a53a6bc1eaaf90cf1e2ca68f0bd

Contents?: true

Size: 998 Bytes

Versions: 96

Compression:

Stored size: 998 Bytes

Contents

require File.join(File.expand_path(File.dirname(__FILE__)), '../../..', 'test_helper.rb')
require 'rbbt/tsv'
require 'rbbt/tsv/parallel'

class TestTSVParallelThrough < Test::Unit::TestCase

  def test_pthrough
    require 'rbbt/sources/organism'
    tsv = Organism.identifiers("Hsa").tsv :unnamed => true, :persist => false, :fields => ["Associated Gene Name"]

    h = {}
    tsv.monitor = true
    tsv.unnamed = true
    tsv.pthrough do |k,v|
      h[k] = v.first
    end

    assert_equal tsv.size, h.size
    assert_equal tsv.keys.sort, h.keys.sort
  end


  def test_ppthrough
    require 'rbbt/sources/organism'
    tsv = Organism.identifiers("Hsa").tsv :unnamed => true, :persist => false, :fields => ["Associated Gene Name"]

    h = {}

    tsv.ppthrough_callback do |k,v|
      h[k] = v
    end

    tsv.unnamed = true
    tsv.monitor = true
    tsv.ppthrough(3) do |k,v|
      [k,v.first]
    end

    assert_equal tsv.size, h.size
    assert_equal tsv.keys.sort, h.keys.sort
  end
end

Version data entries

96 entries across 96 versions & 1 rubygems

Version Path
rbbt-util-5.14.33 test/rbbt/tsv/parallel/test_through.rb
rbbt-util-5.14.32 test/rbbt/tsv/parallel/test_through.rb
rbbt-util-5.14.31 test/rbbt/tsv/parallel/test_through.rb
rbbt-util-5.14.30 test/rbbt/tsv/parallel/test_through.rb
rbbt-util-5.14.29 test/rbbt/tsv/parallel/test_through.rb
rbbt-util-5.14.28 test/rbbt/tsv/parallel/test_through.rb
rbbt-util-5.14.26 test/rbbt/tsv/parallel/test_through.rb
rbbt-util-5.14.25 test/rbbt/tsv/parallel/test_through.rb
rbbt-util-5.14.24 test/rbbt/tsv/parallel/test_through.rb
rbbt-util-5.14.23 test/rbbt/tsv/parallel/test_through.rb
rbbt-util-5.14.22 test/rbbt/tsv/parallel/test_through.rb
rbbt-util-5.14.21 test/rbbt/tsv/parallel/test_through.rb
rbbt-util-5.14.20 test/rbbt/tsv/parallel/test_through.rb
rbbt-util-5.14.18 test/rbbt/tsv/parallel/test_through.rb
rbbt-util-5.14.17 test/rbbt/tsv/parallel/test_through.rb
rbbt-util-5.14.16 test/rbbt/tsv/parallel/test_through.rb
rbbt-util-5.14.15 test/rbbt/tsv/parallel/test_through.rb
rbbt-util-5.14.14 test/rbbt/tsv/parallel/test_through.rb
rbbt-util-5.14.12 test/rbbt/tsv/parallel/test_through.rb
rbbt-util-5.14.11 test/rbbt/tsv/parallel/test_through.rb