resultsMatch <- length(expectedResult) == length(result) &&
all(expectedResult == result)
- expect_that(resultsMatch, is_true())
+ expect_true(resultsMatch)
})
test_that(paste("getFileListing returns sorted names of all direct children",
resultsMatch <- length(expectedResult) == length(result) &&
all(expectedResult == result)
- expect_that(resultsMatch, is_true())
+ expect_true(resultsMatch)
})
test_that("add adds content to inside collection tree", {
animalContainsFish <- animal$get("fish")$getName() == fish$getName()
animalContainsDog <- animal$get("dog")$getName() == dog$getName()
- expect_that(animalContainsFish, is_true())
- expect_that(animalContainsDog, is_true())
+ expect_true(animalContainsFish)
+ expect_true(animalContainsDog)
})
test_that("add raises exception if content name is empty string", {
returnValueAfterRemovalIsNull <- is.null(animal$get("fish"))
- expect_that(returnValueAfterRemovalIsNull, is_true())
+ expect_true(returnValueAfterRemovalIsNull)
})
test_that(paste("remove raises exception",
returnedFishIsSubcollection <- "Subcollection" %in% class(returnedFish)
returnedDogIsArvadosFile <- "ArvadosFile" %in% class(returnedDog)
- expect_that(returnedFishIsSubcollection, is_true())
+ expect_true(returnedFishIsSubcollection)
expect_that(returnedFish$getName(), equals("fish"))
- expect_that(returnedDogIsArvadosFile, is_true())
+ expect_true(returnedDogIsArvadosFile)
expect_that(returnedDog$getName(), equals("dog"))
})
returnedDogIsNull <- is.null(animal$get("dog"))
- expect_that(returnedDogIsNull, is_true())
+ expect_true(returnedDogIsNull)
})
test_that("getFirst returns first child in the subcollection", {
returnedElementIsNull <- is.null(animal$getFirst())
- expect_that(returnedElementIsNull, is_true())
+ expect_true(returnedElementIsNull)
})
test_that(paste("setCollection by default sets collection",
fishCollectionIsNull <- is.null(fish$getCollection())
expect_that(animal$getCollection(), equals("myCollection"))
- expect_that(fishCollectionIsNull, is_true())
+ expect_true(fishCollectionIsNull)
})
test_that(paste("move raises exception if subcollection",
fishIsNullOnOldLocation <- is.null(collection$get("animal/fish"))
fishExistsOnNewLocation <- !is.null(collection$get("fish"))
- expect_that(fishIsNullOnOldLocation, is_true())
- expect_that(fishExistsOnNewLocation, is_true())
+ expect_true(fishIsNullOnOldLocation)
+ expect_true(fishExistsOnNewLocation)
})
test_that(paste("getSizeInBytes returns zero if subcollection",
fishExistsOnOldLocation <- !is.null(collection$get("animal/fish"))
fishExistsOnNewLocation <- !is.null(collection$get("fish"))
- expect_that(fishExistsOnOldLocation, is_true())
- expect_that(fishExistsOnNewLocation, is_true())
+ expect_true(fishExistsOnOldLocation)
+ expect_true(fishExistsOnNewLocation)
})
test_that("duplicate performs deep cloning of Subcollection", {