end
end
end
+
+ # Method to check if rnext, when not '*' or '='
+ # and @SQ header lines are present, is located
+ # in the header hash.
+ def check_rnext(rnext)
+ unless @header.empty? or rnext == '*' or rnext == '='
+ unless @header[:SQ][:SN].has_key? rnext.to_sym
+ raise SamError, "rnext not found in header hash: #{rnext}"
+ end
+ end
+ end
end
assert_raise(SamError) { sam.each }
end
- def test_Sam_each_wtih_rname_present_in_header_dont_raise
+ def test_Sam_each_with_rname_present_in_header_dont_raise
sam = Sam.new(StringIO.new("@SQ\tSN:ref\tLN:45\n*\t*\tref\t*\t*\t*\t*\t*\t\*\t*\t*\n"))
assert_nothing_raised { sam.each }