Sha256: 4f991f62f786ac3b05a949228e5538038163a3e6bd85041c74934d084dc7467f
Contents?: true
Size: 1.77 KB
Versions: 5
Compression:
Stored size: 1.77 KB
Contents
# # test/unit/bio/test_db.rb - Unit test for Bio::DB # # Copyright:: Copyright (C) 2005 Mitsuteru Nakao <n@bioruby.org> # License:: The Ruby License # # $Id:$ # # loading helper routine for testing bioruby require 'pathname' load Pathname.new(File.join(File.dirname(__FILE__), ['..'] * 2, 'bioruby_test_helper.rb')).cleanpath.to_s # libraries needed for the tests require 'test/unit' require 'bio/db' module Bio class TestDB < Test::Unit::TestCase def setup @obj = Bio::DB.new @obj.instance_eval { @orig = {"TAG" => "TAG value1\n value2"} } end def test_open assert(Bio::DB.respond_to?(:open)) end def test_entry_id assert_raises(NotImplementedError) { @obj.entry_id } end def test_tags assert_equal(["TAG"], @obj.tags) end def test_exists assert_equal(true, @obj.exists?("TAG")) end def test_get assert_equal("TAG value1\n value2", @obj.get("TAG")) end def test_fetch assert(@obj.fetch("TAG")) assert(@obj.fetch("TAG", 1)) end end class TestNCBIDB < Test::Unit::TestCase def setup entry =<<END LOCUS locus END @obj = Bio::NCBIDB.new(entry, 10) end def test_fetch assert_equal('locus', @obj.fetch("LOCUS")) end def test_p_toptag2array end def test_p_subtag2array end def test_p_entry2hash end end # class TestKEGGDB < Test::Unit::TestCase # end class TestEMBLDB < Test::Unit::TestCase def setup @entry =<<END ID id XX CC cc1 CC cc2 END @obj = Bio::EMBLDB.new(@entry, 2) end def test_fetch assert_equal('id', @obj.fetch("ID")) assert_equal('cc1 cc2', @obj.fetch("CC")) end def test_p_entry2hash end end end
Version data entries
5 entries across 5 versions & 1 rubygems
Version | Path |
---|---|
bio-1.4.3.0001 | test/unit/bio/test_db.rb |
bio-1.4.3 | test/unit/bio/test_db.rb |
bio-1.4.2 | test/unit/bio/test_db.rb |
bio-1.4.1 | test/unit/bio/test_db.rb |
bio-1.4.0 | test/unit/bio/test_db.rb |