X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/080c940d7a8134a6e277a53b7e45eb27e2b2c87f..ee9d1e39b5d469a827be5a719c9c0860914ab2a8:/sdk/R/tests/testthat/test-CollectionTree.R diff --git a/sdk/R/tests/testthat/test-CollectionTree.R b/sdk/R/tests/testthat/test-CollectionTree.R index 5c8a405269..c4bf9a1da7 100644 --- a/sdk/R/tests/testthat/test-CollectionTree.R +++ b/sdk/R/tests/testthat/test-CollectionTree.R @@ -7,7 +7,7 @@ context("CollectionTree") test_that("constructor creates file tree from character array properly", { collection <- "myCollection" - characterArray <- c("animal", + characterArray <- c("animal", "animal/dog", "boat") @@ -34,22 +34,22 @@ test_that("constructor creates file tree from character array properly", { boat$getCollection() == "myCollection" expect_that(root$getName(), equals("")) - expect_that(rootIsOfTypeSubcollection, is_true()) - expect_that(rootHasNoParent, is_true()) - expect_that(animalIsOfTypeSubcollection, is_true()) - expect_that(animalsParentIsRoot, is_true()) - expect_that(animalContainsDog, is_true()) - expect_that(dogIsOfTypeArvadosFile, is_true()) - expect_that(dogsParentIsAnimal, is_true()) - expect_that(boatIsOfTypeArvadosFile, is_true()) - expect_that(boatsParentIsRoot, is_true()) - expect_that(allElementsBelongToSameCollection, is_true()) -}) + expect_true(rootIsOfTypeSubcollection) + expect_true(rootHasNoParent) + expect_true(animalIsOfTypeSubcollection) + expect_true(animalsParentIsRoot) + expect_true(animalContainsDog) + expect_true(dogIsOfTypeArvadosFile) + expect_true(dogsParentIsAnimal) + expect_true(boatIsOfTypeArvadosFile) + expect_true(boatsParentIsRoot) + expect_true(allElementsBelongToSameCollection) +}) test_that("getElement returns element from tree if element exists on specified path", { collection <- "myCollection" - characterArray <- c("animal", + characterArray <- c("animal", "animal/dog", "boat") @@ -58,12 +58,12 @@ test_that("getElement returns element from tree if element exists on specified p dog <- collectionTree$getElement("animal/dog") expect_that(dog$getName(), equals("dog")) -}) +}) test_that("getElement returns NULL from tree if element doesn't exists on specified path", { collection <- "myCollection" - characterArray <- c("animal", + characterArray <- c("animal", "animal/dog", "boat") @@ -72,13 +72,13 @@ test_that("getElement returns NULL from tree if element doesn't exists on specif fish <- collectionTree$getElement("animal/fish") fishIsNULL <- is.null(fish) - expect_that(fishIsNULL, is_true()) -}) + expect_true(fishIsNULL) +}) test_that("getElement trims ./ from start of relativePath", { collection <- "myCollection" - characterArray <- c("animal", + characterArray <- c("animal", "animal/dog", "boat") @@ -88,12 +88,12 @@ test_that("getElement trims ./ from start of relativePath", { dogWithDotSlash <- collectionTree$getElement("./animal/dog") expect_that(dogWithDotSlash$getName(), equals(dog$getName())) -}) +}) test_that("getElement trims / from end of relativePath", { collection <- "myCollection" - characterArray <- c("animal", + characterArray <- c("animal", "animal/dog", "boat") @@ -103,4 +103,4 @@ test_that("getElement trims / from end of relativePath", { animalWithSlash <- collectionTree$getElement("animal/") expect_that(animalWithSlash$getName(), equals(animal$getName())) -}) +})