Sha256: dcb7cd66158426f2737370a70c353f633f384b02d4862cfe22078bba8437210d

Contents?: true

Size: 1.4 KB

Versions: 7

Compression:

Stored size: 1.4 KB

Contents

require File.expand_path(File.dirname(__FILE__) + '/../../test_helper')

require 'rbbt/sources/pubmed'
require 'test/unit'

class TestPubMed < Test::Unit::TestCase

  def test_get_online
    pmid = '16438716'
    assert(PubMed.get_online(pmid) =~ /Discovering semantic features in the literature: a foundation for building functional associations./)

    pmids = ['16438716', 17204154]
    assert(PubMed.get_online(pmids)[pmid] =~ /Discovering semantic features in the literature: a foundation for building functional associations./)
  end

  def test_get_article
    pmid = '16438716'
    assert(PubMed.get_article(pmid).title == "Discovering semantic features in the literature: a foundation for building functional associations.")
    
    pmids = ['16438716', 17204154]
    assert(PubMed.get_article(pmids)[pmid].title == "Discovering semantic features in the literature: a foundation for building functional associations.")
  end
 
  def test_full_text
    pmid = '16438716'
    assert(PubMed.get_article(pmid).full_text =~ /Discovering/)
  end
 
  def test_query
    assert(PubMed.query('chagoyen[All Fields] AND ("loattrfull text"[sb] AND hasabstract[text])').include? '16438716')
  end

  def test_bibentry
    assert("vazquez2008sent", PubMed::Article.make_bibentry('vazquez', 2008, "SENT: Semantic features in text"))
    assert("vazquez2008aes", PubMed::Article.make_bibentry('vazquez', 2008, "An Example System"))
  end
end


Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
rbbt-sources-1.2.0 test/rbbt/sources/test_pubmed.rb
rbbt-sources-1.1.0 test/rbbt/sources/test_pubmed.rb
rbbt-sources-1.0.1 test/rbbt/sources/test_pubmed.rb
rbbt-sources-1.0.0 test/rbbt/sources/test_pubmed.rb
rbbt-sources-0.4.0 test/rbbt/sources/test_pubmed.rb
rbbt-sources-0.3.1 test/rbbt/sources/test_pubmed.rb
rbbt-sources-0.1.0 test/rbbt/sources/test_pubmed.rb