😎 Give your xaringan slides some style
Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.

41 lines
1007B

  1. import <- function(x) paste0("@import url(", x, ");")
  2. # test_that("list2fonts()", {})
  3. describe("list2fonts()", {
  4. lato_url <- "https://fonts.googleapis.com/css?family=Lato"
  5. worksans_url <- "https://fonts.googleapis.com/css?family=Work+Sans"
  6. it("handles a list of font names", {
  7. expect_equal(
  8. list2fonts(list(lato_url, worksans_url)),
  9. import(c(lato_url, worksans_url))
  10. )
  11. })
  12. it("handles single character font name", {
  13. expect_equal(list2fonts(lato_url), import(lato_url))
  14. })
  15. it("handles list of google fonts", {
  16. expect_equal(
  17. list2fonts(list(google_font("Lato"), google_font("Work Sans"))),
  18. import(c(lato_url, worksans_url))
  19. )
  20. })
  21. it("handles mix of google_font() and bare string", {
  22. expect_equal(
  23. list2fonts(list(google_font("Lato"), worksans_url)),
  24. import(c(lato_url, worksans_url))
  25. )
  26. })
  27. it("handles bare google_font()", {
  28. expect_equal(
  29. list2fonts(google_font("Lato")),
  30. import(lato_url)
  31. )
  32. })
  33. })