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