[BioRuby] Bioruby unit tests

Naohisa GOTO ngoto at gen-info.osaka-u.ac.jp
Sat Jun 13 04:47:02 UTC 2009


Hi Diana,

This is because your original Sequence class definition in line 269
in lib/bio/db/phyloxml.rb violates BioRuby's Bio::Sequence.

The PhyloXML Sequence class (and Events, Date, Id, Uri, etc)
should be defined inside the Bio::PhyloXML namespace.

For example,

module Bio
  class PhyloXML
    class Sequence
      #...
    end
    class Events
      #...
    end
    class Date
      #...
    end
  end
end

In this case, Bio::PhyloXML::Sequence is different from
Bio::Sequence.

Be careful that the name Date is already used by Ruby's
standard bundled library (require 'date'), althogh you can
distinguish it by using ::Date and Bio::PhyloXML::Date.

I also recommend that PhyloXMLTree and PhyloXMLNode are
located inside the Bio::PhyloXML namespace (this means
Bio::PhyloXML::PhyloXMLTree and Bio::PhyloXML::PhyloXMLNode.
If possible, to rename to Bio::PhyloXML::Tree and
Bio::PhyloXML::Node may be a good choice.)

Naohisa Goto
ngoto at gen-info.osaka-u.ac.jp / ng at bioruby.org

On Fri, 12 Jun 2009 11:25:40 -0400
Diana Jaunzeikare <rozziite at gmail.com> wrote:

> Hi all,
> 
> I am working on implementing phyloxml support and I was running only my unit
> tests to test my code. Then yesterday I ran all of the unit tests and it
> gave me errors (when I first cloned it did not gave me any errors). I don't
> think i changed anything in any other file than lib/bio/db/phyloxml.rb and
> test/unit/bio/db/test_phyloxml.rb
> 
> Here is the output of test/runner.rb. Looks all of the errors are of the
> same kind.
> 
> diana at diana-ubuntu:~/bioruby$ ruby test/runner.rb
> Loaded suite .
> Started
> .........................................................................................EE...............................................
(snip)
> Finished in 176.329241 seconds.
> 
>   1) Error:
> test_output_embl(Bio::FuncTestSequenceOutputEMBL):
> ArgumentError: wrong number of arguments (1 for 0)
>     ./lib/bio/sequence.rb:263:in `initialize'
>     ./lib/bio/sequence.rb:263:in `new'
>     ./lib/bio/sequence.rb:263:in `auto'
>     ./test/functional/bio/sequence/test_output_embl.rb:21:in `setup'
> 
>   2) Error:
> test_output_fasta(Bio::FuncTestSequenceOutputEMBL):
> ArgumentError: wrong number of arguments (1 for 0)
>     ./lib/bio/sequence.rb:263:in `initialize'
>     ./lib/bio/sequence.rb:263:in `new'
>     ./lib/bio/sequence.rb:263:in `auto'
>     ./test/functional/bio/sequence/test_output_embl.rb:21:in `setup'
> 
>   3) Error:
> test_alignment(Bio::TestAlignmentMultiFastaFormat):
> ArgumentError: wrong number of arguments (1 for 0)
>     ./lib/bio/sequence.rb:443:in `initialize'
>     ./lib/bio/sequence.rb:443:in `new'
>     ./lib/bio/sequence.rb:443:in `adapter'
>     ./lib/bio/db/fasta.rb:221:in `to_seq'
>     ./lib/bio/appl/mafft/report.rb:90:in `determine_seq_method'
>     ./lib/bio/appl/mafft/report.rb:89:in `each'
>     ./lib/bio/appl/mafft/report.rb:89:in `determine_seq_method'
>     ./lib/bio/appl/mafft/report.rb:61:in `alignment'
>     ./test/unit/bio/appl/mafft/test_report.rb:47:in `test_alignment'
> 
>   4) Error:
> test_determine_seq_method(Bio::TestAlignmentMultiFastaFormat):
> ArgumentError: wrong number of arguments (1 for 0)
>     ./lib/bio/sequence.rb:443:in `initialize'
>     ./lib/bio/sequence.rb:443:in `new'
>     ./lib/bio/sequence.rb:443:in `adapter'
>     ./lib/bio/db/fasta.rb:221:in `to_seq'
>     ./lib/bio/appl/mafft/report.rb:90:in `determine_seq_method'
>     ./lib/bio/appl/mafft/report.rb:89:in `each'
>     ./lib/bio/appl/mafft/report.rb:89:in `determine_seq_method'
>     ./lib/bio/appl/mafft/report.rb:61:in `alignment'
>     ./test/unit/bio/appl/mafft/test_report.rb:57:in
> `test_determine_seq_method'
> 
>   5) Error:
> test_const_version(Bio::TestGFF3):
> ArgumentError: wrong number of arguments (1 for 0)
>     ./lib/bio/sequence.rb:443:in `initialize'
>     ./lib/bio/sequence.rb:443:in `new'
>     ./lib/bio/sequence.rb:443:in `adapter'
>     ./lib/bio/db/fasta.rb:221:in `to_seq'
>     ./lib/bio/db/gff.rb:954:in `parse_fasta'
>     ./lib/bio/db/gff.rb:949:in `each_line'
>     ./lib/bio/db/gff.rb:949:in `parse_fasta'
>     ./lib/bio/db/gff.rb:941:in `parse'
>     ./lib/bio/db/gff.rb:881:in `initialize'
>     ./test/unit/bio/db/test_gff.rb:644:in `new'
>     ./test/unit/bio/db/test_gff.rb:644:in `setup'
> 
>   6) Error:
> test_gff_version(Bio::TestGFF3):
> ArgumentError: wrong number of arguments (1 for 0)
>     ./lib/bio/sequence.rb:443:in `initialize'
>     ./lib/bio/sequence.rb:443:in `new'
>     ./lib/bio/sequence.rb:443:in `adapter'
>     ./lib/bio/db/fasta.rb:221:in `to_seq'
>     ./lib/bio/db/gff.rb:954:in `parse_fasta'
>     ./lib/bio/db/gff.rb:949:in `each_line'
>     ./lib/bio/db/gff.rb:949:in `parse_fasta'
>     ./lib/bio/db/gff.rb:941:in `parse'
>     ./lib/bio/db/gff.rb:881:in `initialize'
>     ./test/unit/bio/db/test_gff.rb:644:in `new'
>     ./test/unit/bio/db/test_gff.rb:644:in `setup'
> 
>   7) Error:
> test_records(Bio::TestGFF3):
> ArgumentError: wrong number of arguments (1 for 0)
>     ./lib/bio/sequence.rb:443:in `initialize'
>     ./lib/bio/sequence.rb:443:in `new'
>     ./lib/bio/sequence.rb:443:in `adapter'
>     ./lib/bio/db/fasta.rb:221:in `to_seq'
>     ./lib/bio/db/gff.rb:954:in `parse_fasta'
>     ./lib/bio/db/gff.rb:949:in `each_line'
>     ./lib/bio/db/gff.rb:949:in `parse_fasta'
>     ./lib/bio/db/gff.rb:941:in `parse'
>     ./lib/bio/db/gff.rb:881:in `initialize'
>     ./test/unit/bio/db/test_gff.rb:644:in `new'
>     ./test/unit/bio/db/test_gff.rb:644:in `setup'
> 
>   8) Error:
> test_sequence_regions(Bio::TestGFF3):
> ArgumentError: wrong number of arguments (1 for 0)
>     ./lib/bio/sequence.rb:443:in `initialize'
>     ./lib/bio/sequence.rb:443:in `new'
>     ./lib/bio/sequence.rb:443:in `adapter'
>     ./lib/bio/db/fasta.rb:221:in `to_seq'
>     ./lib/bio/db/gff.rb:954:in `parse_fasta'
>     ./lib/bio/db/gff.rb:949:in `each_line'
>     ./lib/bio/db/gff.rb:949:in `parse_fasta'
>     ./lib/bio/db/gff.rb:941:in `parse'
>     ./lib/bio/db/gff.rb:881:in `initialize'
>     ./test/unit/bio/db/test_gff.rb:644:in `new'
>     ./test/unit/bio/db/test_gff.rb:644:in `setup'
> [....]
> 2175 tests, 5180 assertions, 0 failures, 54 errors
> 
> 
> Any ideas?  Code is available here
> http://github.com/latvianlinuxgirl/bioruby/tree/dev
> 
> Diana
> 





More information about the BioRuby mailing list