[BioRuby-cvs] bioruby/test/unit/bio/util test_restriction_enzyme.rb, NONE, 1.1

Trevor Wennblom trevor at dev.open-bio.org
Sun Dec 31 23:50:36 UTC 2006


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

Added Files:
	test_restriction_enzyme.rb 
Log Message:
Added TestRestrictionEnzyme

--- NEW FILE: test_restriction_enzyme.rb ---
#
# test/unit/bio/util/restriction_enzyme.rb - Unit test for Bio::RestrictionEnzyme
#
# Author::    Trevor Wennblom  <mailto:trevor at corevx.com>
# Copyright:: Copyright (c) 2005-2007 Midwinter Laboratories, LLC (http://midwinterlabs.com)
# License::   Distributes under the same terms as Ruby
#
#  $Id: test_restriction_enzyme.rb,v 1.1 2006/12/31 23:50:34 trevor Exp $
#

require 'pathname'
libpath = Pathname.new(File.join(File.dirname(__FILE__), ['..'] * 4, 'lib')).cleanpath.to_s
$:.unshift(libpath) unless $:.include?(libpath)

require 'test/unit'
require 'bio/util/restriction_enzyme.rb'

module Bio #:nodoc:

class TestRestrictionEnzyme < Test::Unit::TestCase #:nodoc:

  def setup
    @t = Bio::RestrictionEnzyme
  end
  
  def test_rebase
    assert_equal(@t.rebase.respond_to?(:enzymes), true)
    assert_not_nil @t.rebase['AarI']
    assert_nil @t.rebase['blah']
  end
  
  def test_enzyme_name
    assert_equal(@t.enzyme_name?('AarI'), true)
    assert_equal(@t.enzyme_name?('atgc'), false)
    assert_equal(@t.enzyme_name?('aari'), true)
    assert_equal(@t.enzyme_name?('EcoRI'), true)
    assert_equal(@t.enzyme_name?('EcoooRI'), true) # FIXME should actually be false
  end

end

end




More information about the bioruby-cvs mailing list