test_that("new deck generated", {
expect_s4_class(new_deck(),"deck")
})
test_that("new card generated", {
expect_s4_class(new_card(),"card")
})
#Tests for the function new_cards()
test_that("cards limited at 52", {
expect_error(new_cards(53,new_deck()),regexp = "Not enough cards remaining in the deck")
})
test_that("new_cards correct output format",{
cards <- new_cards(3,new_deck())
for (i in 1:3){
expect_s4_class(cards[[i]],"card")
}
expect_s4_class(cards[[4]],"deck")
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.