Skip to content

Commit

Permalink
check it can call with different super arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
robertzk committed Mar 1, 2015
1 parent c3d2b8d commit 57d8f19
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions tests/testthat/test-super.R
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,22 @@ test_that("it errors when no super method exists", {
expect_error(not_a_function(), "No parent function")
})

test_that("it can call with different super arguments", {
calls <- integer(0)
function1 <- function(x) {
calls <<- c(calls, x)
}

function2 <- function() {
function1 <- function(y) {
calls <<- c(calls, y)
super(2)
}
function1(1)
}
function2()

expect_equal(calls, c(1L, 2L))
})


0 comments on commit 57d8f19

Please sign in to comment.