Skip to content

Commit

Permalink
Merge pull request #16 from Ryo-N7/fix-tests-#15
Browse files Browse the repository at this point in the history
Fix tests #15
  • Loading branch information
Ryo-N7 authored Dec 14, 2020
2 parents 5f67166 + 759b1c3 commit 18e26d2
Show file tree
Hide file tree
Showing 14 changed files with 59 additions and 33 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Type: Package
Package: tvthemes
Title: TV Show Themes and Color Palettes for 'ggplot2' Graphics
Version: 1.2.0
Version: 1.1.1
Authors@R:
person(given = "Ryo",
family = "Nakagawara",
Expand Down
4 changes: 3 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# tvthemes 1.2.0
# tvthemes 1.1.1

* Add Github Actions
* R-CMD-Check, codecov, build pkgdown
* Add license for 'Some Time Later' font
* Fix tests, re: check environment

# tvthemes 1.1.0

Expand Down
4 changes: 3 additions & 1 deletion tests/testthat/test-attackontitan.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
context("test-attackontitan")

expect_eqNe <- function(...) expect_equal(..., check.environment = FALSE)

## Attack on Titan
test_that("attackOnTitan_pal raises warning with large number, x > 8", {
expect_warning(attackOnTitan_pal()(9))
Expand All @@ -8,7 +10,7 @@ test_that("attackOnTitan_pal raises warning with large number, x > 8", {
})

test_that("scale_colour_attackOnTitan equals scale_color_attackOnTitan", {
expect_equal(scale_color_attackOnTitan(), scale_colour_attackOnTitan())
expect_eqNe(scale_color_attackOnTitan(), scale_colour_attackOnTitan())
})

test_that("scale_colour_attackOnTitan works", {
Expand Down
4 changes: 3 additions & 1 deletion tests/testthat/test-bighero6.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
context("test-bighero6")

expect_eqNe <- function(...) expect_equal(..., check.environment=FALSE)

## Big Hero 6
test_that("bigHero6_pal raises warning with large number, x > 8", {
expect_warning(bigHero6_pal()(9))
Expand All @@ -8,7 +10,7 @@ test_that("bigHero6_pal raises warning with large number, x > 8", {
})

test_that("scale_colour_bigHero6 equals scale_color_bigHero6", {
expect_equal(scale_color_bigHero6(), scale_colour_bigHero6())
expect_eqNe(scale_color_bigHero6(), scale_colour_bigHero6())
})

test_that("scale_color_bigHero6 name is correct", {
Expand Down
6 changes: 4 additions & 2 deletions tests/testthat/test-brooklyn99.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
context("test-brooklyn99")

expect_eqNe <- function(...) expect_equal(..., check.environment=FALSE)

test_that("theme_brooklyn99 works", {
thm <- theme_brooklyn99()
expect_s3_class(thm, "theme")
Expand Down Expand Up @@ -62,8 +64,8 @@ test_that("brooklyn99_pal raises warning with large number, x > 10", {
})

test_that("scale_colour_brooklyn99/dark equals scale_color_brooklyn99/dark", {
expect_equal(scale_color_brooklyn99(palette = "Regular"), scale_colour_brooklyn99(palette = "Regular"))
expect_equal(scale_color_brooklyn99(palette = "Dark"), scale_colour_brooklyn99(palette = "Dark"))
expect_eqNe(scale_color_brooklyn99(palette = "Regular"), scale_colour_brooklyn99(palette = "Regular"))
expect_eqNe(scale_color_brooklyn99(palette = "Dark"), scale_colour_brooklyn99(palette = "Dark"))
})

test_that("scale_colour_brooklyn99/dark works", {
Expand Down
22 changes: 12 additions & 10 deletions tests/testthat/test-gameofthrones.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
context("test-gameofthrones")

expect_eqNe <- function(...) expect_equal(..., check.environment = FALSE)

## House Stark ----
test_that("stark_pal raises warning with large number, x > 9", {
expect_warning(westeros_pal(palette = "Stark")(10))
Expand All @@ -8,7 +10,7 @@ test_that("stark_pal raises warning with large number, x > 9", {
})

test_that("scale_colour_stark equals scale_color_stark", {
expect_equal(scale_color_westeros(palette = "Stark"), scale_colour_westeros(palette = "Stark"))
expect_eqNe(scale_color_westeros(palette = "Stark"), scale_colour_westeros(palette = "Stark"))
})

test_that("scale_colour_stark works", {
Expand All @@ -25,7 +27,7 @@ test_that("Lannister_pal raises warning with large number, x > 9", {
})

test_that("scale_colour_Lannister equals scale_color_Lannister", {
expect_equal(scale_color_westeros(palette = "Lannister"), scale_colour_westeros(palette = "Lannister"))
expect_eqNe(scale_color_westeros(palette = "Lannister"), scale_colour_westeros(palette = "Lannister"))
})

test_that("scale_colour_Lannister works", {
Expand All @@ -42,7 +44,7 @@ test_that("Tyrell_pal raises warning with large number, x > 9", {
})

test_that("scale_colour_Tyrell equals scale_color_Tyrell", {
expect_equal(scale_color_westeros(palette = "Tyrell"), scale_colour_westeros(palette = "Tyrell"))
expect_eqNe(scale_color_westeros(palette = "Tyrell"), scale_colour_westeros(palette = "Tyrell"))
})

test_that("scale_colour_Tyrell works", {
Expand All @@ -59,7 +61,7 @@ test_that("Targaryen_pal raises warning with large number, x > 9", {
})

test_that("scale_colour_Targaryen equals scale_color_Targaryen", {
expect_equal(scale_color_westeros(palette = "Targaryen"), scale_colour_westeros(palette = "Targaryen"))
expect_eqNe(scale_color_westeros(palette = "Targaryen"), scale_colour_westeros(palette = "Targaryen"))
})

test_that("scale_colour_Targaryen works", {
Expand All @@ -76,7 +78,7 @@ test_that("Tully_pal raises warning with large number, x > 9", {
})

test_that("scale_colour_Tully equals scale_color_Tully", {
expect_equal(scale_color_westeros(palette = "Tully"), scale_colour_westeros(palette = "Tully"))
expect_eqNe(scale_color_westeros(palette = "Tully"), scale_colour_westeros(palette = "Tully"))
})

test_that("scale_colour_Tully works", {
Expand All @@ -93,7 +95,7 @@ test_that("Greyjoy_pal raises warning with large number, x > 9", {
})

test_that("scale_colour_Greyjoy equals scale_color_Greyjoy", {
expect_equal(scale_color_westeros(palette = "Greyjoy"), scale_colour_westeros(palette = "Greyjoy"))
expect_eqNe(scale_color_westeros(palette = "Greyjoy"), scale_colour_westeros(palette = "Greyjoy"))
})

test_that("scale_colour_Greyjoy works", {
Expand All @@ -110,7 +112,7 @@ test_that("Manderly_pal raises warning with large number, x > 9", {
})

test_that("scale_colour_Manderly equals scale_color_Manderly", {
expect_equal(scale_color_westeros(palette = "Manderly"), scale_colour_westeros(palette = "Manderly"))
expect_eqNe(scale_color_westeros(palette = "Manderly"), scale_colour_westeros(palette = "Manderly"))
})

test_that("scale_colour_Manderly works", {
Expand All @@ -127,7 +129,7 @@ test_that("Stannis_pal raises warning with large number, x > 9", {
})

test_that("scale_colour_Stannis equals scale_color_Stannis", {
expect_equal(scale_color_westeros(palette = "Stannis"), scale_colour_westeros(palette = "Stannis"))
expect_eqNe(scale_color_westeros(palette = "Stannis"), scale_colour_westeros(palette = "Stannis"))
})

test_that("scale_colour_Stannis works", {
Expand All @@ -144,7 +146,7 @@ test_that("Martell_pal raises warning with large number, x > 9", {
})

test_that("scale_colour_Martell equals scale_color_Martell", {
expect_equal(scale_color_westeros(palette = "Martell"), scale_colour_westeros(palette = "Martell"))
expect_eqNe(scale_color_westeros(palette = "Martell"), scale_colour_westeros(palette = "Martell"))
})

test_that("scale_colour_Martell works", {
Expand All @@ -161,7 +163,7 @@ test_that("Arryn_pal raises warning with large number, x > 9", {
})

test_that("scale_colour_Arryn equals scale_color_Arryn", {
expect_equal(scale_color_westeros(palette = "Arryn"), scale_colour_westeros(palette = "Arryn"))
expect_eqNe(scale_color_westeros(palette = "Arryn"), scale_colour_westeros(palette = "Arryn"))
})

test_that("scale_colour_Arryn works", {
Expand Down
4 changes: 3 additions & 1 deletion tests/testthat/test-gravityfalls.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
context("test-gravityFalls")

expect_eqNe <- function(...) expect_equal(..., check.environment = FALSE)

## Big Hero 6
test_that("gravityFalls_pal raises warning with large number, x > 15", {
expect_warning(gravityFalls_pal()(15))
Expand All @@ -8,7 +10,7 @@ test_that("gravityFalls_pal raises warning with large number, x > 15", {
})

test_that("scale_colour_gravityFalls equals scale_color_gravityFalls", {
expect_equal(scale_color_gravityFalls(), scale_colour_gravityFalls())
expect_eqNe(scale_color_gravityFalls(), scale_colour_gravityFalls())
})

test_that("scale_color_gravityFalls name is correct", {
Expand Down
8 changes: 5 additions & 3 deletions tests/testthat/test-hilda.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
context("test-hilda")

expect_eqNe <- function(...) expect_equal(..., check.environment = FALSE)

# Hilda Day ----
test_that("theme_hildaDay works", {
thm <- theme_hildaDay()
Expand Down Expand Up @@ -64,7 +66,7 @@ test_that("hilda_pal raises warning with large number, x > 8", {
})

test_that("scale_colour_hilda equals scale_color_hilda", {
expect_equal(scale_color_hilda(palette = "Day"), scale_colour_hilda(palette = "Day"))
expect_eqNe(scale_color_hilda(palette = "Day"), scale_colour_hilda(palette = "Day"))
})

test_that("scale_colour_hilda works", {
Expand Down Expand Up @@ -137,7 +139,7 @@ test_that("hilda_pal raises warning with large number, x > 8", {
})

test_that("scale_colour_hilda equals scale_color_hilda", {
expect_equal(scale_color_hilda(palette = "Dusk"), scale_colour_hilda(palette = "Dusk"))
expect_eqNe(scale_color_hilda(palette = "Dusk"), scale_colour_hilda(palette = "Dusk"))
})

test_that("scale_colour_hilda works", {
Expand Down Expand Up @@ -210,7 +212,7 @@ test_that("hilda_pal raises warning with large number, x > 8", {
})

test_that("scale_colour_hilda equals scale_color_hilda", {
expect_equal(scale_color_hilda(palette = "Night"), scale_colour_hilda(palette = "Night"))
expect_eqNe(scale_color_hilda(palette = "Night"), scale_colour_hilda(palette = "Night"))
})

test_that("scale_colour_hilda works", {
Expand Down
4 changes: 3 additions & 1 deletion tests/testthat/test-kimpossible.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
context("test-kimpossible")

expect_eqNe <- function(...) expect_equal(..., check.environment = FALSE)

## Kim Possible
test_that("kimPossible_pal raises warning with large number, x > 12", {
expect_warning(kimPossible_pal()(13))
Expand All @@ -8,7 +10,7 @@ test_that("kimPossible_pal raises warning with large number, x > 12", {
})

test_that("scale_colour_kimPossible equals scale_color_kimPossible", {
expect_equal(scale_color_kimPossible(), scale_colour_kimPossible())
expect_eqNe(scale_color_kimPossible(), scale_colour_kimPossible())
})

test_that("scale_color_kimPossible name is correct", {
Expand Down
4 changes: 3 additions & 1 deletion tests/testthat/test-parksandrec.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
context("test-parksandrec")

expect_eqNe <- function(...) expect_equal(..., check.environment = FALSE)

test_that("theme_parksAndRec works", {
thm <- theme_parksAndRec()
expect_s3_class(thm, "theme")
Expand Down Expand Up @@ -174,7 +176,7 @@ test_that("parksAndRec_pal raises warning with large number, x > 10", {
})

test_that("scale_colour_parksAndRec equals scale_color_parksAndRec", {
expect_equal(scale_color_parksAndRec(), scale_colour_parksAndRec())
expect_eqNe(scale_color_parksAndRec(), scale_colour_parksAndRec())
})

test_that("scale_colour_parksAndRec/light works", {
Expand Down
4 changes: 3 additions & 1 deletion tests/testthat/test-rickandmorty.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
context("test-rickandmorty")

expect_eqNe <- function(...) expect_equal(..., check.environment = FALSE)

test_that("theme_rickAndMorty works", {
thm <- theme_rickAndMorty()
expect_s3_class(thm, "theme")
Expand Down Expand Up @@ -62,7 +64,7 @@ test_that("rickAndMorty_pal raises warning with large number, x > 9", {
})

test_that("scale_colour_rickAndMorty equals scale_color_rickAndMorty", {
expect_equal(scale_color_rickAndMorty(), scale_colour_rickAndMorty())
expect_eqNe(scale_color_rickAndMorty(), scale_colour_rickAndMorty())
})

test_that("scale_colour_rickAndMorty works", {
Expand Down
4 changes: 3 additions & 1 deletion tests/testthat/test-simpsons.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
context("test-simpsons")

expect_eqNe <- function(...) expect_equal(..., check.environment = FALSE)

test_that("theme_simpsons works", {
thm <- theme_simpsons()
expect_s3_class(thm, "theme")
Expand Down Expand Up @@ -62,7 +64,7 @@ test_that("simpsons_pal raises warning with large number, x > 10", {
})

test_that("scale_colour_simpsons equals scale_color_simpsons", {
expect_equal(scale_color_simpsons(), scale_colour_simpsons())
expect_eqNe(scale_color_simpsons(), scale_colour_simpsons())
})

test_that("scale_colour_simpsons works", {
Expand Down
4 changes: 3 additions & 1 deletion tests/testthat/test-spongebob.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
context("test-spongebob")

expect_eqNe <- function(...) expect_equal(..., check.environment = FALSE)

test_that("theme_spongeBob works", {
thm <- theme_spongeBob()
expect_s3_class(thm, "theme")
Expand Down Expand Up @@ -62,7 +64,7 @@ test_that("spongeBob_pal raises warning with large number, x > 9", {
})

test_that("scale_colour_spongeBob equals scale_color_spongeBob", {
expect_equal(scale_color_spongeBob(), scale_colour_spongeBob())
expect_eqNe(scale_color_spongeBob(), scale_colour_spongeBob())
})

test_that("scale_colour_spongeBob works", {
Expand Down
18 changes: 10 additions & 8 deletions tests/testthat/test-thelastairbender.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
context("test-thelastairbender")

expect_eqNe <- function(...) expect_equal(..., check.environment=FALSE)

test_that("theme_theLastAirbender works", {
thm <- theme_theLastAirbender()
expect_s3_class(thm, "theme")
Expand Down Expand Up @@ -122,7 +124,7 @@ test_that("fireNation_pal raises warning with large number, x > 8", {
})

test_that("scale_colour_fireNation equals scale_color_fireNation", {
expect_equal(scale_color_avatarTLA(palette = "FireNation"), scale_colour_avatarTLA(palette = "FireNation"))
expect_eqNe(scale_color_avatarTLA(palette = "FireNation"), scale_colour_avatarTLA(palette = "FireNation"))
})

test_that("scale_colour_fireNation works", {
Expand All @@ -139,7 +141,7 @@ test_that("WaterTribe_pal raises warning with large number, x > 8", {
})

test_that("scale_colour_WaterTribe equals scale_color_WaterTribe", {
expect_equal(scale_color_avatarTLA(palette = "WaterTribe"), scale_colour_avatarTLA(palette = "WaterTribe"))
expect_eqNe(scale_color_avatarTLA(palette = "WaterTribe"), scale_colour_avatarTLA(palette = "WaterTribe"))
})

test_that("scale_colour_WaterTribe works", {
Expand All @@ -156,7 +158,7 @@ test_that("EarthKingdom_pal raises warning with large number, x > 9", {
})

test_that("scale_colour_EarthKingdom equals scale_color_EarthKingdom", {
expect_equal(scale_color_avatarTLA(palette = "EarthKingdom"), scale_colour_avatarTLA(palette = "EarthKingdom"))
expect_eqNe(scale_color_avatarTLA(palette = "EarthKingdom"), scale_colour_avatarTLA(palette = "EarthKingdom"))
})

test_that("scale_colour_EarthKingdom works", {
Expand All @@ -173,7 +175,7 @@ test_that("AirNomads_pal raises warning with large number, x > 8", {
})

test_that("scale_colour_AirNomads equals scale_color_AirNomads", {
expect_equal(scale_color_avatarTLA(palette = "AirNomads"), scale_colour_avatarTLA(palette = "AirNomads"))
expect_eqNe(scale_color_avatarTLA(palette = "AirNomads"), scale_colour_avatarTLA(palette = "AirNomads"))
})

test_that("scale_colour_AirNomads works", {
Expand Down Expand Up @@ -264,7 +266,7 @@ test_that("fireNation_pal raises warning with large number, x > 8", {
})

test_that("scale_colour_fireNation equals scale_color_fireNation", {
expect_equal(scale_color_avatar(palette = "FireNation"), scale_colour_avatar(palette = "FireNation"))
expect_eqNe(scale_color_avatar(palette = "FireNation"), scale_colour_avatar(palette = "FireNation"))
})

test_that("scale_colour_fireNation works", {
Expand All @@ -281,7 +283,7 @@ test_that("WaterTribe_pal raises warning with large number, x > 8", {
})

test_that("scale_colour_WaterTribe equals scale_color_WaterTribe", {
expect_equal(scale_color_avatar(palette = "WaterTribe"), scale_colour_avatar(palette = "WaterTribe"))
expect_eqNe(scale_color_avatar(palette = "WaterTribe"), scale_colour_avatar(palette = "WaterTribe"))
})

test_that("scale_colour_WaterTribe works", {
Expand All @@ -298,7 +300,7 @@ test_that("EarthKingdom_pal raises warning with large number, x > 9", {
})

test_that("scale_colour_EarthKingdom equals scale_color_EarthKingdom", {
expect_equal(scale_color_avatar(palette = "EarthKingdom"), scale_colour_avatar(palette = "EarthKingdom"))
expect_eqNe(scale_color_avatar(palette = "EarthKingdom"), scale_colour_avatar(palette = "EarthKingdom"))
})

test_that("scale_colour_EarthKingdom works", {
Expand All @@ -315,7 +317,7 @@ test_that("AirNomads_pal raises warning with large number, x > 8", {
})

test_that("scale_colour_AirNomads equals scale_color_AirNomads", {
expect_equal(scale_color_avatar(palette = "AirNomads"), scale_colour_avatar(palette = "AirNomads"))
expect_eqNe(scale_color_avatar(palette = "AirNomads"), scale_colour_avatar(palette = "AirNomads"))
})

test_that("scale_colour_AirNomads works", {
Expand Down

0 comments on commit 18e26d2

Please sign in to comment.