Skip to content

Commit

Permalink
Remove unmockable test
Browse files Browse the repository at this point in the history
  • Loading branch information
richfitz committed Jul 6, 2023
1 parent aee1539 commit 412d22c
Showing 1 changed file with 0 additions and 28 deletions.
28 changes: 0 additions & 28 deletions tests/testthat/test-main.R
Original file line number Diff line number Diff line change
Expand Up @@ -133,31 +133,3 @@ test_that("main_worker_args", {
list(queue_id = "orderly",
go_signal = "/go-signal"))
})


test_that("main worker starts rrq worker", {
mock_rrq_worker <- mockery::mock(list(loop = function() TRUE), cycle = TRUE)
with_mock("rrq::rrq_worker_from_config" = mock_rrq_worker, {
worker <- main_worker("queue_id")
})
args <- mockery::mock_args(mock_rrq_worker)[[1]]
expect_equal(args[[1]], "queue_id")
})

test_that("main worker waits for go signal", {
path <- tempfile()
dir.create(path)

go_signal <- file.path(path, "go")
dt <- as.difftime(1, units = "secs")
mock_rrq_worker <- mockery::mock(list(loop = function() TRUE), cycle = TRUE)
mock_wait_while <- mockery::mock(dt, cycle = TRUE)
msg <- capture_messages(
with_mock("orderly.server:::wait_while" = mock_wait_while,
"rrq::rrq_worker_from_config" = mock_rrq_worker,
worker <- main_worker(c("--go-signal", go_signal, "queue_id"))))

mockery::expect_called(mock_wait_while, 1)
args <- mockery::mock_args(mock_rrq_worker)[[1]]
expect_equal(args[[1]], "queue_id")
})

0 comments on commit 412d22c

Please sign in to comment.