tests/testthat/_snaps/spec_guess_object.md

gives nice errors

Code
  (expect_error(guess_tspec_object(tibble(a = 1))))
Output
  <error/rlang_error>
  Error in `guess_tspec_object()`:
  ! `x` must not be a dataframe.
  i Did you want to use `guess_tspec_df()` instead?
Code
  (expect_error(guess_tspec_object(1:3)))
Output
  <error/rlang_error>
  Error in `guess_tspec_object()`:
  ! `x` must be a list. Instead, it is a <integer>.
Code
  (expect_error(guess_tspec_object(list(1, a = 1))))
Output
  <error/rlang_error>
  Error in `guess_tspec_object()`:
  ! `x` must be fully named.
Code
  (expect_error(guess_tspec_object(list(a = 1, a = 1))))
Output
  <error/rlang_error>
  Error in `guess_tspec_object()`:
  ! Names of `x` must be unique.


Try the tibblify package in your browser

Any scripts or data that you put into this service are public.

tibblify documentation built on Nov. 16, 2022, 5:07 p.m.