[BioRuby-cvs] bioruby/test/unit/bio test_reference.rb, 1.3, 1.3.2.1 test_feature.rb, 1.5, 1.5.2.1
Naohisa Goto
ngoto at dev.open-bio.org
Thu May 8 05:38:03 UTC 2008
Update of /home/repository/bioruby/bioruby/test/unit/bio
In directory dev.open-bio.org:/tmp/cvs-serv10599/test/unit/bio
Modified Files:
Tag: BRANCH-biohackathon2008
test_reference.rb test_feature.rb
Log Message:
Unit test codes are changed due to the changes of Bio::References and
Bio::Features (those are obsoleted but exist for backaward compatibility).
Index: test_feature.rb
===================================================================
RCS file: /home/repository/bioruby/bioruby/test/unit/bio/test_feature.rb,v
retrieving revision 1.5
retrieving revision 1.5.2.1
diff -C2 -d -r1.5 -r1.5.2.1
*** test_feature.rb 5 Apr 2007 23:35:42 -0000 1.5
--- test_feature.rb 8 May 2008 05:38:01 -0000 1.5.2.1
***************
*** 15,18 ****
--- 15,19 ----
require 'test/unit'
require 'bio/feature'
+ require 'bio/compat/features'
***************
*** 89,96 ****
--- 90,124 ----
end
+ class NullStderr
+ def initialize
+ @log = []
+ end
+
+ def write(*arg)
+ #p arg
+ @log.push([ :write, *arg ])
+ nil
+ end
+
+ def method_missing(*arg)
+ #p arg
+ @log.push arg
+ nil
+ end
+ end
+
class TestFeatures < Test::Unit::TestCase
def setup
+ # To suppress warning messages, $stderr is replaced by dummy object.
+ @stderr_orig = $stderr
+ $stderr = NullStderr.new
+
@obj = Bio::Features.new([Bio::Feature.new('gene', '1..615', [])])
end
+
+ def teardown
+ # bring back $stderr
+ $stderr = @stderr_orig
+ end
def test_features
Index: test_reference.rb
===================================================================
RCS file: /home/repository/bioruby/bioruby/test/unit/bio/test_reference.rb,v
retrieving revision 1.3
retrieving revision 1.3.2.1
diff -C2 -d -r1.3 -r1.3.2.1
*** test_reference.rb 5 Apr 2007 23:35:42 -0000 1.3
--- test_reference.rb 8 May 2008 05:38:01 -0000 1.3.2.1
***************
*** 15,18 ****
--- 15,19 ----
require 'test/unit'
require 'bio/reference'
+ require 'bio/compat/references'
***************
*** 173,179 ****
--- 174,202 ----
end
+ class NullStderr
+ def initialize
+ @log = []
+ end
+
+ def write(*arg)
+ #p arg
+ @log.push([ :write, *arg ])
+ nil
+ end
+
+ def method_missing(*arg)
+ #p arg
+ @log.push arg
+ nil
+ end
+ end
+
class TestReferences < Test::Unit::TestCase
def setup
+ # To suppress warning messages, $stderr is replaced by dummy object.
+ @stderr_orig = $stderr
+ $stderr = NullStderr.new
+
hash = {}
ary = [Bio::Reference.new(hash),
***************
*** 182,185 ****
--- 205,213 ----
end
+ def teardown
+ # bring back $stderr
+ $stderr = @stderr_orig
+ end
+
def test_append
hash = {}
More information about the bioruby-cvs
mailing list