From 1068bfca0538d66e479670dc90227341a824972d Mon Sep 17 00:00:00 2001 From: martinahansen Date: Mon, 5 Sep 2011 06:30:51 +0000 Subject: [PATCH] polished test_cigar.rb git-svn-id: http://biopieces.googlecode.com/svn/trunk@1512 74ccb610-7750-0410-82ae-013aeee3265d --- code_ruby/lib/maasha/cigar.rb | 2 +- code_ruby/test/maasha/test_cigar.rb | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/code_ruby/lib/maasha/cigar.rb b/code_ruby/lib/maasha/cigar.rb index 78e3afe..800fc14 100644 --- a/code_ruby/lib/maasha/cigar.rb +++ b/code_ruby/lib/maasha/cigar.rb @@ -133,7 +133,7 @@ class Cigar # Method to check that the CIGAR string is formatted # correctly, including hard clipping and soft clipping - # can't be located internally. + # that cant be located internally. def check_cigar unless cigar =~ /^(\*|([0-9]+[MIDNSHPX=])+)$/ raise CigarError, "Bad cigar format: #{cigar}" diff --git a/code_ruby/test/maasha/test_cigar.rb b/code_ruby/test/maasha/test_cigar.rb index d4e014f..78df1b7 100755 --- a/code_ruby/test/maasha/test_cigar.rb +++ b/code_ruby/test/maasha/test_cigar.rb @@ -42,6 +42,10 @@ class CigarTest < Test::Unit::TestCase assert_nothing_raised { Cigar.new("1H1S1M1S1H") } end + def test_Cigar_to_s_returns_correctly + assert_equal("1M", Cigar.new("1M").to_s) + end + def test_Cigar_each_returns_correctly cigar = Cigar.new("10M") -- 2.39.5