[BioRuby-cvs] bioruby/test/unit/bio test_reference.rb, 1.3.2.1, 1.3.2.2

Naohisa Goto ngoto at dev.open-bio.org
Tue Jun 17 12:24:44 UTC 2008


Update of /home/repository/bioruby/bioruby/test/unit/bio
In directory dev.open-bio.org:/tmp/cvs-serv20093/test/unit/bio

Modified Files:
      Tag: BRANCH-biohackathon2008
	test_reference.rb 
Log Message:
merged changes from trunk (revision 1.5)


Index: test_reference.rb
===================================================================
RCS file: /home/repository/bioruby/bioruby/test/unit/bio/test_reference.rb,v
retrieving revision 1.3.2.1
retrieving revision 1.3.2.2
diff -C2 -d -r1.3.2.1 -r1.3.2.2
*** test_reference.rb	8 May 2008 05:38:01 -0000	1.3.2.1
--- test_reference.rb	17 Jun 2008 12:24:41 -0000	1.3.2.2
***************
*** 92,96 ****
  
      def test_format_endnote
!       str = "%0 Journal Article\n%A Hoge, J.P.\n%A Fuga, F.B.\n%D 2001\n%T Title of the study.\n%J Theor. J. Hoge\n%V 12\n%N 3\n%P 123-145\n%M 12345678\n%U http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=Retrieve&db=PubMed&dopt=Citation&list_uids=12345678\n%X Hoge fuga. hoge fuga.\n%K Hoge\n%+ Tokyo"
        assert_equal(str, @obj.format('endnote'))
        assert_equal(str, @obj.endnote)
--- 92,96 ----
  
      def test_format_endnote
!       str = "%0 Journal Article\n%A Hoge, J.P.\n%A Fuga, F.B.\n%D 2001\n%T Title of the study.\n%J Theor. J. Hoge\n%V 12\n%N 3\n%P 123-145\n%M 12345678\n%U http://example.com\n%X Hoge fuga. hoge fuga.\n%K Hoge\n%+ Tokyo"
        assert_equal(str, @obj.format('endnote'))
        assert_equal(str, @obj.endnote)
***************
*** 104,122 ****
  
      def test_format_bibtex
!       str =<<END
!         @article{PMID:12345678,
!           author  = {Hoge, J.P. and Fuga, F.B.},
!           title   = {Title of the study.},
!           journal = {Theor. J. Hoge},
!           year    = {2001},
!           volume  = {12},
!           number  = {3},
!           pages   = {123--145},
!         }
! END
        assert_equal(str, @obj.format('bibtex'))
        assert_equal(str, @obj.bibtex)
      end
  
      def test_format_rd
        str = "== Title of the study.\n\n* Hoge, J.P. and Fuga, F.B.\n\n* Theor. J. Hoge 2001 12:123-145 [PMID:12345678]\n\nHoge fuga. hoge fuga."
--- 104,148 ----
  
      def test_format_bibtex
!       str =<<__END__
! @article{PMID:12345678,
!   author       = {Hoge, J.P. and Fuga, F.B.},
!   title        = {Title of the study.},
!   journal      = {Theor. J. Hoge},
!   year         = {2001},
!   volume       = {12},
!   number       = {3},
!   pages        = {123--145},
!   url          = {http://example.com},
! }
! __END__
        assert_equal(str, @obj.format('bibtex'))
        assert_equal(str, @obj.bibtex)
      end
  
+     def test_format_bibtex_with_arguments
+       str =<<__END__
+ @inproceedings{YourArticle,
+   author       = {Hoge, J.P. and Fuga, F.B.},
+   title        = {Title of the study.},
+   year         = {2001},
+   volume       = {12},
+   number       = {3},
+   pages        = {123--145},
+   booktitle    = {Theor. J. Hoge},
+   month        = {December},
+ }
+ __END__
+       assert_equal(str, @obj.format('bibtex', 'inproceedings', 'YourArticle',
+                                     { 'journal'   => false,
+                                       'url' => false,
+                                       'booktitle' => @obj.journal,
+                                       'month' => 'December'}))
+       assert_equal(str, @obj.bibtex('inproceedings', 'YourArticle',
+                                     { 'journal'   => false,
+                                       'url' => false,
+                                       'booktitle' => @obj.journal,
+                                       'month' => 'December'}))
+     end
+ 
      def test_format_rd
        str = "== Title of the study.\n\n* Hoge, J.P. and Fuga, F.B.\n\n* Theor. J. Hoge 2001 12:123-145 [PMID:12345678]\n\nHoge fuga. hoge fuga."




More information about the bioruby-cvs mailing list