D
Diana Jaunzeikare
[Note: parts of this message were removed to make it a legal post.]
Hi all,
I am developing support for PhyloXML in BioRuby as Google Summer of Code
project. I have a question about unit testing.
My code depends on libxml-ruby library (other parts of BioRuby does not). So
I want to test if libxml-ruby is required and then if it is not, i want to
quit my unit test suite (a file tes_phyloxml.rb) nicely (don't perform any
unit tests related to phyloxml since they anyways gonna fail) but the rest
of unit test suites should continue running.
Right now the it completely exits, if can't load xml library, but I would
like the other tests to continue running.
#First let's test if xml library is here, since it will be required by
bio/db/phyloxml
begin
require 'xml'
rescue LoadError
puts "Please install libxml-ruby library. It is needed for Bio:
hyloXML
module. Unit tests will exit now.
exit 1
end
require 'bio/db/phyloxml'
class TestPhyloXML1 < Test::Unit::TestCase
def setup
@phyloxml = Bio:
hyloXML.new(TestPhyloXMLData.example_xml)
end
def test_init
assert_equal(@phyloxml.class, Bio:
hyloXML)
end
#[...]
end
Thanks,
Diana
Hi all,
I am developing support for PhyloXML in BioRuby as Google Summer of Code
project. I have a question about unit testing.
My code depends on libxml-ruby library (other parts of BioRuby does not). So
I want to test if libxml-ruby is required and then if it is not, i want to
quit my unit test suite (a file tes_phyloxml.rb) nicely (don't perform any
unit tests related to phyloxml since they anyways gonna fail) but the rest
of unit test suites should continue running.
Right now the it completely exits, if can't load xml library, but I would
like the other tests to continue running.
#First let's test if xml library is here, since it will be required by
bio/db/phyloxml
begin
require 'xml'
rescue LoadError
puts "Please install libxml-ruby library. It is needed for Bio:
module. Unit tests will exit now.
exit 1
end
require 'bio/db/phyloxml'
class TestPhyloXML1 < Test::Unit::TestCase
def setup
@phyloxml = Bio:
end
def test_init
assert_equal(@phyloxml.class, Bio:
end
#[...]
end
Thanks,
Diana