Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion R/aFIPC.R
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,12 @@ autoFIPC <-
...
) {
# print credits
message('automated Fixed Item Parameter Calibration: aFIPC 0.2')
message(
paste0(
'automated Fixed Item Parameter Calibration: aFIPC ',
as.character(utils::packageVersion('aFIPC'))
)
)
message('Seongho Bae (seongho@kw.ac.kr)\n')
try(invisible(gc()), silent = T)
# garbage cleaning
Expand Down
28 changes: 28 additions & 0 deletions tests/testthat/test-package-version-banner.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
test_that("autoFIPC banner reports the installed package version", {
messages <- character()

expect_error(
withCallingHandlers(
aFIPC::autoFIPC(
newformXData = NULL,
oldformYData = NULL,
newformCommonItemNames = character(),
oldformCommonItemNames = character()
),
message = function(condition) {
messages <<- c(messages, conditionMessage(condition))
invokeRestart("muffleMessage")
}
),
"newformXData must be a data.frame, matrix, or a valid fitted mirt model"
)

expect_gte(length(messages), 1L)
expect_identical(
messages[[1]],
paste0(
"automated Fixed Item Parameter Calibration: aFIPC ",
as.character(utils::packageVersion("aFIPC"))
)
)
})
Loading