Skip to content

Commit

Permalink
Improved test
Browse files Browse the repository at this point in the history
  • Loading branch information
kojix2 committed Sep 20, 2024
1 parent 5e51d5c commit d585696
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions test/bigwig_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,27 @@ def bwurl
"https://raw.githubusercontent.com/dpryan79/pyBigWig/master/pyBigWigTest/test.bw"
end

def bedfile
File.expand_path("fixtures/test.bigBed", __dir__)
end

def test_open
bw = Bio::BigWig.new(bwfile)
assert_equal Bio::BigWig, bw.class
bw.close
end

def test_open_with_block
Bio::BigWig.open(bwfile) do |bw|
assert_equal Bio::BigWig, bw.class
end
end

def test_open_remote
skip "Skipping remote test" unless ENV['RUN_REMOTE_TESTS'] == '1'

Bio::BigWig.open(bwurl) do |bw|
assert_equal Bio::BigWig, bw.class
assert_equal "BigWig", bw.file_type
end
end

def test_file_type
Bio::BigWig.open(bwfile) do |bw|
assert_equal "BigWig", bw.file_type
Expand Down Expand Up @@ -62,6 +73,7 @@ def test_header
%i[bwfile].each do |fname|
define_method("test_chroms_#{fname}") do
bw = Bio::BigWig.new(public_send(fname))
assert_instance_of(Hash, bw.chroms)
assert_equal({ "1" => 195_471_971, "10" => 130_694_993 }, bw.chroms)
assert_equal(195_471_971, bw.chroms("1"))
assert_equal(130_694_993, bw.chroms("10"))
Expand Down

0 comments on commit d585696

Please sign in to comment.