Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dieghernan committed Nov 28, 2024
1 parent 6ddfddc commit 7632c91
Show file tree
Hide file tree
Showing 10 changed files with 19 additions and 34 deletions.
3 changes: 0 additions & 3 deletions CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,6 @@ references:
email: [email protected]
orcid: https://orcid.org/0000-0002-4035-0289
year: '2024'
identifiers:
- type: url
value: https://arxiv.org/abs/1403.2805
doi: 10.32614/CRAN.package.jsonlite
version: '>= 1.7.2'
- type: software
Expand Down
5 changes: 1 addition & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ file and the `CITATION` file (if present) of your package. Note that
**cffr** works best if your package pass
`R CMD check/devtools::check()`.

As per 2024-11-28 there are at least 398 repos on GitHub using **cffr**.
As per 2024-11-28 there are at least 416 repos on GitHub using **cffr**.
[Check them out
here](https://github.com/search?q=cffr%20path%3A**%2FCITATION.cff&type=code).

Expand Down Expand Up @@ -394,9 +394,6 @@ test <- cff_create("rmarkdown")
email: [email protected]
orcid: https://orcid.org/0000-0002-4035-0289
year: '2024'
identifiers:
- type: url
value: https://arxiv.org/abs/1403.2805
doi: 10.32614/CRAN.package.jsonlite
- type: software
title: knitr
Expand Down
4 changes: 2 additions & 2 deletions codemeta.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"name": "R",
"url": "https://r-project.org"
},
"runtimePlatform": "R version 4.4.2 (2024-10-31)",
"runtimePlatform": "R version 4.4.2 (2024-10-31 ucrt)",
"provider": {
"@id": "https://cran.r-project.org",
"@type": "Organization",
Expand Down Expand Up @@ -200,7 +200,7 @@
},
"isPartOf": "https://ropensci.org",
"keywords": ["attribution", "citation", "credit", "citation-files", "cff", "metadata", "citation-file-format", "cran", "r", "r-package", "ropensci", "rstats"],
"fileSize": "1604.169KB",
"fileSize": "1624.077KB",
"citation": [
{
"@type": "ScholarlyArticle",
Expand Down
Binary file modified data/cran_to_spdx.rda
Binary file not shown.
2 changes: 1 addition & 1 deletion inst/schemaorg.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@
"name": "Comprehensive R Archive Network (CRAN)",
"url": "https://cran.r-project.org"
},
"runtimePlatform": "R version 4.4.2 (2024-10-31)",
"runtimePlatform": "R version 4.4.2 (2024-10-31 ucrt)",
"version": "1.1.1"
}
4 changes: 2 additions & 2 deletions man/cff_class.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 0 additions & 8 deletions tests/testthat/_snaps/methods.md
Original file line number Diff line number Diff line change
Expand Up @@ -914,14 +914,6 @@
`date-start` = "2017-01-01", `date-end` = "2017-01-31", location = "The team garage"
))), class = "person")

---

Code
format(aut2, include = c("given", "family", "email", "role", "comment"))
Output
[1] "One Truly van der Real Person, IV <[email protected]> (Citey, Excellent University, Niceplace, Arcadia, 22 Acacia Avenue, Citationburgh, Renfrewshire, C13 7X7, GB, <https://orcid.org/0000-0001-2345-6789>, +44(0)141-323 4567, +44(0)141-323 45678, https://www.entity-project-team.io)"
[2] "Entity Project Team Conference entity <[email protected]> (22 Acacia Avenue, Citationburgh, Renfrewshire, C13 7X7, GB, <https://orcid.org/0000-0001-2345-6789>, +44(0)141-323 4567, +44(0)141-323 45678, https://www.entity-project-team.io, 2017-01-01, 2017-01-31, The team garage)"

---

Code
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-cff_create.R
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ test_that("Parsing wrong urls", {
skip_on_cran()

rvers <- getRversion()
skip_if(rvers < "4.4.1", "Snapshot created with R 4.4.*")
skip_if(!grepl("^4.4", rvers), "Snapshot created with R 4.4.*")

desc_path <- system.file("examples/DESCRIPTION_wrong_urls", package = "cffr")

Expand Down
23 changes: 11 additions & 12 deletions tests/testthat/test-methods.R
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,6 @@ test_that("as.person method", {
expect_s3_class(aut2[1], "person")
expect_s3_class(aut2[2], "person")
expect_snapshot(dput(aut2))
expect_snapshot(
format(aut2, include = c("given", "family", "email", "role", "comment"))
)

# Malformed
malf <- getref$authors
Expand Down Expand Up @@ -291,25 +288,27 @@ test_that("toBibtex", {
"{The Big Bopper} and Frank Sinatra and Dean Martin and Davis, Jr., Sammy"
)

comp <- c(
person("The Big Bopper"), person("Frank", "Sinatra"),
person("Dean", "Martin"), person("Sammy", "Davis, Jr.")
)

expect_length(sev_auth, 4)
expect_s3_class(sev_auth, "cff_pers_lst")
expect_equal(
toBibtex(sev_auth),
paste(
"{The Big Bopper} and Sinatra, Frank and",
"Martin, Dean and Davis, Jr., Sammy"
)
)
expect_identical(toBibtex(sev_auth), toBibtex(comp))

# Single person
single <- as_cff_person(person("A", "person", email = "[email protected]"))[[1]]
expect_s3_class(single, "cff_pers")
expect_equal(toBibtex(single), "person, A")
expect_identical(toBibtex(single), toBibtex(person("A", "person")))

# Single entity
single <- as_cff_person(person("{A and B co}", email = "[email protected]"))[[1]]
expect_s3_class(single, "cff_pers")
expect_equal(toBibtex(single), "{A and B co}")
expect_identical(
toBibtex(single),
toBibtex(person("A and B co", email = "[email protected]"))
)
})


Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-utils-create.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
test_that("Merge all DESCRIPTION files with CITATION_basic", {
rvers <- getRversion()
skip_if(rvers < "4.4.1", "Snapshot created with R 4.4.*")
skip_if(!grepl("^4.4", rvers), "Snapshot created with R 4.4.*")
skip_on_cran()

allfiles <- list.files(
Expand Down

0 comments on commit 7632c91

Please sign in to comment.