@@ -58,15 +58,27 @@ testthat::test_that("get_cards returns the same cards which was added to reporte
5858})
5959
6060testthat :: test_that(" get_blocks returns the same blocks which was added to reporter, sep = NULL" , {
61- reporter <- test_reporter(card1 <- test_card1(), card2 <- test_card2())
62- testthat :: expect_identical(reporter $ get_blocks(sep = NULL ), append(unclass(card1 ), unclass(card2 )))
61+ reporter <- test_reporter(card1 <- test_card1(" A title" ), card2 <- test_card2(" Another title" ))
62+ testthat :: expect_identical(
63+ reporter $ get_blocks(sep = NULL ),
64+ append(
65+ c(sprintf(" # %s" , metadata(card1 , " title" )), card1 ),
66+ c(sprintf(" # %s" , metadata(card2 , " title" )), card2 )
67+ )
68+ )
6369})
6470
6571testthat :: test_that(" get_blocks by default adds NewpageBlock$new() between cards" , {
66- reporter <- test_reporter(card1 <- test_card1(), card2 <- test_card2())
72+ card1 <- test_card1(" A title" )
73+ card2 <- test_card2(" Another title" )
74+ reporter <- test_reporter(card1 , card2 )
75+
76+ reporter_1 <- Reporter $ new()$ append_cards(card1 )
77+ reporter_2 <- Reporter $ new()$ append_cards(card2 )
78+
6779 reporter_blocks <- reporter $ get_blocks()
68- reporter_blocks2 <- append(reporter_blocks [ 1 : 3 ] , " \\ newpage" )
69- reporter_blocks2 <- append(reporter_blocks2 , reporter_blocks [ 5 : 8 ] )
80+ reporter_blocks2 <- append(reporter_1 $ get_blocks() , " \\ newpage" )
81+ reporter_blocks2 <- append(reporter_blocks2 , reporter_2 $ get_blocks() )
7082 testthat :: expect_equal(reporter $ get_blocks(), reporter_blocks2 )
7183})
7284
0 commit comments