1
1
test_that(" render_book() works" , {
2
- withr :: local_envvar(BABELQUARTO_TESTS_URL = " true" )
3
-
4
2
parent_dir <- withr :: local_tempdir()
5
3
project_dir <- " blop"
6
4
quarto_multilingual_book(
@@ -23,8 +21,6 @@ test_that("render_book() works", {
23
21
})
24
22
25
23
test_that(" render_book() works - change link" , {
26
- withr :: local_envvar(BABELQUARTO_TESTS_URL = " true" )
27
-
28
24
parent_dir <- withr :: local_tempdir()
29
25
project_dir <- " blop"
30
26
quarto_multilingual_book(
@@ -48,8 +44,6 @@ test_that("render_book() works - change link", {
48
44
})
49
45
50
46
test_that(" render_book() works -- chapters in folders" , {
51
- withr :: local_envvar(BABELQUARTO_TESTS_URL = " true" )
52
-
53
47
parent_dir <- withr :: local_tempdir()
54
48
project_dir <- " blop"
55
49
quarto_multilingual_book(
@@ -88,8 +82,6 @@ test_that("render_book() works -- chapters in folders", {
88
82
})
89
83
90
84
test_that(" render_website() works" , {
91
- withr :: local_envvar(BABELQUARTO_TESTS_URL = " true" )
92
-
93
85
parent_dir <- withr :: local_tempdir()
94
86
project_dir <- " blop"
95
87
quarto_multilingual_website(
@@ -127,14 +119,11 @@ test_that("render_website() works", {
127
119
)
128
120
expect_identical(
129
121
xml2 :: xml_attr(english_link , " href" ),
130
- " https://example.com/index.html" )
131
- expect_identical(xml2 :: xml_text(english_link ), " Version in en"
122
+ " https://example.com/index.html"
132
123
)
133
-
124
+ expect_identical( xml2 :: xml_text( english_link ), " Version in en " )
134
125
})
135
126
test_that(" render_book() works -- partial template" , {
136
- withr :: local_envvar(BABELQUARTO_TESTS_URL = " true" )
137
-
138
127
parent_dir <- withr :: local_tempdir()
139
128
project_dir <- " blop"
140
129
quarto_multilingual_website(
@@ -191,12 +180,9 @@ test_that("render_book() works -- partial template", {
191
180
' //div[@class="alert alert-info alert-dismissible"]'
192
181
)
193
182
expect_match(xml2 :: xml_text(div ), " Salut" )
194
-
195
183
})
196
184
197
185
test_that(" render_book() works - appendices" , {
198
- withr :: local_envvar(BABELQUARTO_TESTS_URL = " true" )
199
-
200
186
parent_dir <- withr :: local_tempdir()
201
187
project_dir <- " blop"
202
188
quarto_multilingual_book(
@@ -218,13 +204,9 @@ test_that("render_book() works - appendices", {
218
204
219
205
withr :: with_dir(parent_dir , render_book(project_dir ))
220
206
expect_dir_exists(file.path(parent_dir , project_dir , " _book" ))
221
-
222
-
223
207
})
224
208
225
209
test_that(" render_book() works - chapters" , {
226
- withr :: local_envvar(BABELQUARTO_TESTS_URL = " true" )
227
-
228
210
parent_dir <- withr :: local_tempdir()
229
211
project_dir <- " blop"
230
212
quarto_multilingual_book(
@@ -247,13 +229,9 @@ test_that("render_book() works - chapters", {
247
229
248
230
withr :: with_dir(parent_dir , render_book(project_dir ))
249
231
expect_dir_exists(file.path(parent_dir , project_dir , " _book" ))
250
-
251
-
252
232
})
253
233
254
234
test_that(" render_book() works - parts and chapters" , {
255
- withr :: local_envvar(BABELQUARTO_TESTS_URL = " true" )
256
-
257
235
parent_dir <- withr :: local_tempdir()
258
236
project_dir <- " blop"
259
237
quarto_multilingual_book(
@@ -290,12 +268,9 @@ test_that("render_book() works - parts and chapters", {
290
268
291
269
withr :: with_dir(parent_dir , render_book(project_dir ))
292
270
expect_dir_exists(file.path(parent_dir , project_dir , " _book" ))
293
-
294
271
})
295
272
296
273
test_that(" render_website() works - listing" , {
297
- withr :: local_envvar(BABELQUARTO_TESTS_URL = " true" )
298
-
299
274
parent_dir <- withr :: local_tempdir()
300
275
project_dir <- " blop"
301
276
quarto_multilingual_website(
@@ -344,8 +319,6 @@ test_that("render_website() works - listing", {
344
319
})
345
320
346
321
test_that(" render_website() works - clean render for each language" , {
347
- withr :: local_envvar(BABELQUARTO_TESTS_URL = " true" )
348
-
349
322
parent_dir <- withr :: local_tempdir()
350
323
project_dir <- " blop"
351
324
quarto_multilingual_website(
@@ -381,8 +354,6 @@ test_that("render_website() works - clean render for each language", {
381
354
382
355
test_that(" render_website() fails when missing sidebar
383
356
and languagelinks is set to sidebar" , {
384
- withr :: local_envvar(BABELQUARTO_TESTS_URL = " true" )
385
-
386
357
parent_dir <- withr :: local_tempdir()
387
358
project_dir <- " blop"
388
359
quarto_multilingual_website(
@@ -406,8 +377,6 @@ test_that("render_website() fails when missing sidebar
406
377
407
378
test_that(" render_book() fails when missing navbar
408
379
and languagelinks is set to navbar" , {
409
- withr :: local_envvar(BABELQUARTO_TESTS_URL = " true" )
410
-
411
380
parent_dir <- withr :: local_tempdir()
412
381
project_dir <- " blop"
413
382
@@ -432,8 +401,6 @@ test_that("render_book() fails when missing navbar
432
401
})
433
402
434
403
test_that(" book with navbar placement has languagelinks in the navbar" , {
435
- withr :: local_envvar(BABELQUARTO_TESTS_URL = " true" )
436
-
437
404
parent_dir <- withr :: local_tempdir()
438
405
project_dir <- " blop"
439
406
@@ -461,8 +428,6 @@ test_that("book with navbar placement has languagelinks in the navbar", {
461
428
})
462
429
463
430
test_that(" website with sidebar placement has languagelinks in the sidebar" , {
464
- withr :: local_envvar(BABELQUARTO_TESTS_URL = " true" )
465
-
466
431
parent_dir <- withr :: local_tempdir()
467
432
project_dir <- " blop"
468
433
@@ -490,7 +455,6 @@ test_that("website with sidebar placement has languagelinks in the sidebar", {
490
455
})
491
456
492
457
test_that(" render_book() works - all language links are present in sidebar" , {
493
-
494
458
parent_dir <- withr :: local_tempdir()
495
459
project_dir <- " blop"
496
460
@@ -579,7 +543,6 @@ test_that("render_book() works - all language links are present in sidebar", {
579
543
})
580
544
581
545
test_that(" render_website() works - all language links are present in navbar" , {
582
-
583
546
parent_dir <- withr :: local_tempdir()
584
547
project_dir <- " blop"
585
548
@@ -656,7 +619,6 @@ test_that("render_website() works - all language links are present in navbar", {
656
619
" href"
657
620
)
658
621
expect_identical(index_es_link_fr , " https://ropensci.org/fr/index.html" )
659
-
660
622
})
661
623
662
624
@@ -683,7 +645,6 @@ test_that("render_website() works - all language links are present in navbar", {
683
645
expect_file_exists(
684
646
file.path(parent_dir , project_dir , " _site" , " es" , " practices.html" )
685
647
)
686
-
687
648
})
688
649
689
650
0 commit comments