vcr icon indicating copy to clipboard operation
vcr copied to clipboard

Helpers for test file level and test_that chunk level cassette inspection/manipulation

Open sckott opened this issue 6 years ago • 3 comments

It would make it easier to re-record cassettes, delete certain ones, etc. if there were fxns to tell the user what cassettes were associated with which test files and within each file, associated with which test_that blocks. e.g.,

summary/information

vcr_summary()
test-wm_distribution.R  
├── wm_distribution.yml
├── wm_distribution_.yml
├── wm_distribution_many.yml
test-wm_ranks.R
├── wm_ranks_id.yml
├── wm_ranks_id_error.yml
├── wm_ranks_name.yml
├── wm_ranks_name_error.yml

manipulation

delete

by test file - delete all cassettes used by the test file

# complete name
vcr_rm(files = "test-wm_distribution.R")
# partial name
vcr_rm(files = "wm_distribution.R")
vcr_rm(files = "wm_distribution")
# regex for one to many
vcr_rm(files = "wm_*", fuzzy = TRUE)

by test_that block - either require user to give file too, or just regex across all test_that blocks?

vcr_rm(block = "wm_distribution basic test")

sckott avatar Jun 28 '19 17:06 sckott

I like this idea :-) it'd also help seeing duplicates cf #116

maelle avatar Nov 04 '19 13:11 maelle

thanks for the upvote

sckott avatar Nov 04 '19 19:11 sckott

wait for https://github.com/ropensci/vcr/issues/152 to have a full listing of test files, cassettes named within each test file, and associated fixture files

sckott avatar Feb 14 '20 19:02 sckott