def test_Seq_is_protein_with_protein_sequence_type_returns_true
@entry.type = 'protein'
- assert(@entry.is_protein? == true)
+ assert_equal(true, @entry.is_protein?)
+ end
+
+ def test_Seq_type_guess_without_sequence_raises
+ assert_raise(SeqError) { @entry.type_guess }
+ end
+
+ def test_Seq_type_guess_with_protein_returns_protein
+ @entry.seq = 'atcatcrFgatcg'
+ assert_equal('protein', @entry.type_guess)
+ end
+
+ def test_Seq_type_guess_with_rna_returns_rna
+ @entry.seq = 'atcatcrUgatcg'
+ assert_equal('rna', @entry.type_guess)
+ end
+
+ def test_Seq_type_guess_with_dna_returns_dna
+ @entry.seq = 'atcatcgatcg'
+ assert_equal('dna', @entry.type_guess)
+ end
+
+ def test_Seq_type_guess_EM_without_sequence_raises
+ assert_raise(SeqError) { @entry.type_guess! }
+ end
+
+ def test_Seq_type_guess_EM_with_protein_returns_protein
+ @entry.seq = 'atcatcrFgatcg'
+ @entry.type_guess!
+ assert_equal('protein', @entry.type)
+ end
+
+ def test_Seq_type_guess_EM_with_rna_returns_rna
+ @entry.seq = 'atcatcrUgatcg'
+ @entry.type_guess!
+ assert_equal('rna', @entry.type)
+ end
+
+ def test_Seq_type_guess_EM_with_dna_returns_dna
+ @entry.seq = 'atcatcgatcg'
+ @entry.type_guess!
+ assert_equal('dna', @entry.type)
end
def test_Seq_length_is_correct