Sha256: a290b1bb06005596eac67b526baa543dcfe5d91e2519f1fdd02d765e112f2d2c
Contents?: true
Size: 989 Bytes
Versions: 10
Compression:
Stored size: 989 Bytes
Contents
require File.join(File.expand_path(File.dirname(__FILE__)), '../..', 'test_helper.rb') require 'rbbt/tsv' require 'rbbt/tsv/parallel' class TestTSVParallel < 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
10 entries across 10 versions & 1 rubygems