Skip to content

Commit

Permalink
test(utils): test uninstalled GenomicRanges for get_granges_string
Browse files Browse the repository at this point in the history
  • Loading branch information
jamespeapen committed Nov 29, 2024
1 parent 8bcebda commit e56427b
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion tests/testthat/test-get_regions.R
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
options("iscream.threads" = 1)

regions <- c("chr1:1-6", "chr1:7-10", "chr1:11-14")
gr <- GenomicRanges::GRanges(regions)

with_mocked_bindings(
{
expect_error(
get_granges_string(gr),
"The 'GenomicRanges' package must be installed for this functionality"
)
},
requireNamespace = function(package, ..., quietly=FALSE) FALSE,
.package="base"
)

test_that("Test GRanges to string", {
expect_equal(get_granges_string(gr), regions)
})
Expand Down

0 comments on commit e56427b

Please sign in to comment.