Skip to content

Commit 5a2605d

Browse files
committed
chore: Adapt to current testthat
1 parent 185938f commit 5a2605d

File tree

4 files changed

+29
-34
lines changed

4 files changed

+29
-34
lines changed

tests/testthat/_snaps/deconstruct.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -251,64 +251,64 @@
251251
Code
252252
tbl_sum(keyed_tbl_impl(dm_output, "d1"))
253253
Output
254-
Keys
255-
"`origin`, `time_hour` | 0 | 0"
254+
A tibble Keys
255+
"144 x 15" "`origin`, `time_hour` | 0 | 0"
256256

257257
---
258258

259259
Code
260260
tbl_sum(keyed_tbl_impl(dm_output, "d2"))
261261
Output
262-
Keys
263-
"`faa` | 0 | 0"
262+
A tibble Keys
263+
"86 x 8" "`faa` | 0 | 0"
264264

265265
---
266266

267267
Code
268268
tbl_sum(keyed_tbl_impl(new_dm_output, "d1"))
269269
Output
270-
Keys
271-
"`origin`, `time_hour` | 0 | 0"
270+
A tibble Keys
271+
"144 x 15" "`origin`, `time_hour` | 0 | 0"
272272

273273
---
274274

275275
Code
276276
tbl_sum(keyed_tbl_impl(new_dm_output, "d2"))
277277
Output
278-
Keys
279-
"`faa` | 0 | 0"
278+
A tibble Keys
279+
"86 x 8" "`faa` | 0 | 0"
280280

281281
# `dm()` and `new_dm()` can handle a mix of tables and `dm_keyed_tbl` objects
282282

283283
Code
284284
tbl_sum(keyed_tbl_impl(dm_output, "d1"))
285285
Output
286-
Keys
287-
"`origin`, `time_hour` | 0 | 0"
286+
A tibble Keys
287+
"144 x 15" "`origin`, `time_hour` | 0 | 0"
288288

289289
---
290290

291291
Code
292292
tbl_sum(keyed_tbl_impl(dm_output, "d2"))
293293
Output
294-
Keys
295-
"--- | 0 | 0"
294+
A tibble Keys
295+
"86 x 8" "--- | 0 | 0"
296296

297297
---
298298

299299
Code
300300
tbl_sum(keyed_tbl_impl(new_dm_output, "d1"))
301301
Output
302-
Keys
303-
"`origin`, `time_hour` | 0 | 0"
302+
A tibble Keys
303+
"144 x 15" "`origin`, `time_hour` | 0 | 0"
304304

305305
---
306306

307307
Code
308308
tbl_sum(keyed_tbl_impl(new_dm_output, "d2"))
309309
Output
310-
Keys
311-
"--- | 0 | 0"
310+
A tibble Keys
311+
"86 x 8" "--- | 0 | 0"
312312

313313
# `dm()` handles missing key column names gracefully
314314

tests/testthat/_snaps/zoom.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@
33
Code
44
dm_for_filter() %>% dm_zoom_to(tf_5) %>% as_dm_zoomed_df() %>% tbl_sum()
55
Output
6-
Zoomed table
7-
"tf_5"
6+
Zoomed table A tibble
7+
"tf_5" "4 x 4"
88

99
---
1010

1111
Code
1212
dm_for_filter() %>% dm_zoom_to(tf_2) %>% as_dm_zoomed_df() %>% tbl_sum()
1313
Output
14-
Zoomed table
15-
"tf_2"
14+
Zoomed table A tibble
15+
"tf_2" "6 x 4"
1616

1717
# zoom output for compound keys
1818

tests/testthat/helper-print.R

Lines changed: 0 additions & 14 deletions
This file was deleted.

tests/testthat/setup.R

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,12 @@ local_options(
99
pillar.bold = NULL,
1010
.frame = teardown_env()
1111
)
12+
13+
if (rlang::is_installed("dbplyr")) {
14+
local_mocked_bindings(
15+
tbl_sum.tbl_sql = function(x, ...) c(),
16+
tbl_format_header.tbl_sql = function(x, ...) invisible(),
17+
.package = "dbplyr",
18+
.env = teardown_env()
19+
)
20+
}

0 commit comments

Comments
 (0)