spec/bio-bgzf_spec.rb in bio-bgzf-0.1.0 vs spec/bio-bgzf_spec.rb in bio-bgzf-0.1.1
- old
+ new
@@ -6,9 +6,18 @@
it "should be able to pack strings to BGZF blocks" do
Bio::BGZF.should respond_to(:pack).with(1).argument
Bio::BGZF.pack("asdfghjkl").should be_instance_of String
end
+ it "should be able to read BGZF blocks from a samtools file" do
+ File.open("test/data/mm8.chrM.maf.gz") do |f|
+ r = Bio::BGZF::Reader.new(f)
+ r.each_block do |block|
+ block.size.should <= 65536
+ end
+ end
+ end
+
it "should be able to iteratively read BGZF blocks from stream" do
str = ''
1000.times { str += (Random.rand(26) + 65).chr }
file = Tempfile.new 'bgzfstring'