@@ -12,13 +12,21 @@ teardown({
1212})
1313
1414
15+ assert_supported_rotor_version <- function (){ # TODO: change to throwing an error once rotor 0.3.0 is on CRAN
16+ if (packageVersion(" rotor" ) < " 0.3.0" )
17+ skip(" rotor < 0.3.0 is no longer supported" )
18+ }
19+
20+
1521
1622# AppenderFileRotating -----------------------------------------------------
1723
1824test_that(" AppenderFileRotating: works as expected" , {
1925 if (! is_zipcmd_available())
2026 skip(" Test requires a workings system zip command" )
2127
28+ assert_supported_rotor_version()
29+
2230 tf <- file.path(td , " test.log" )
2331 app <- AppenderFileRotating $ new(file = tf , size = " 1tb" )
2432
@@ -72,6 +80,8 @@ test_that("AppenderFileRotating: works with different backup_dir", {
7280 if (! is_zipcmd_available())
7381 skip(" Test requires a workings system zip command" )
7482
83+ assert_supported_rotor_version()
84+
7585 tf <- file.path(td , " test.log" )
7686 bu_dir <- file.path(td , " backups" )
7787
@@ -125,6 +135,9 @@ test_that("AppenderFileRotating: works with different backup_dir", {
125135
126136
127137test_that(" AppenderFileRotating: `size` argument works as expected" , {
138+
139+ assert_supported_rotor_version()
140+
128141 # setup
129142 tf <- file.path(td , " test.log" )
130143 app <- AppenderFileRotating $ new(file = tf )$ set_size(- 1 )
@@ -154,6 +167,8 @@ test_that("AppenderFileRotatingDate: works as expected", {
154167 if (! is_zipcmd_available())
155168 skip(" Test requires a workings system zip command" )
156169
170+ assert_supported_rotor_version()
171+
157172 tf <- file.path(td , " test.log" )
158173 app <- AppenderFileRotatingDate $ new(file = tf , size = " 1tb" )
159174 lg <-
@@ -214,6 +229,8 @@ test_that("AppenderFileRotatingDate: works with different backup_dir", {
214229 if (! is_zipcmd_available())
215230 skip(" Test requires a workings system zip command" )
216231
232+ assert_supported_rotor_version()
233+
217234 tf <- file.path(td , " test.log" )
218235 bu_dir <- file.path(td , " backups" )
219236
@@ -256,6 +273,8 @@ test_that("AppenderFileRotatingDate: works with different backup_dir", {
256273
257274
258275test_that(" AppenderFileRotatingDate: `size` and `age` arguments work as expected" , {
276+ assert_supported_rotor_version()
277+
259278 # setup
260279 tf <- file.path(td , " test.log" )
261280 app <- AppenderFileRotatingDate $ new(file = tf )$ set_age(- 1 )
@@ -293,6 +312,8 @@ test_that("AppenderFileRotatingTime: works as expected", {
293312 if (! is_zipcmd_available())
294313 skip(" Test requires a workings system zip command" )
295314
315+ assert_supported_rotor_version()
316+
296317 tf <- file.path(td , " test.log" )
297318 app <- AppenderFileRotatingTime $ new(file = tf )
298319 lg <-
@@ -339,6 +360,8 @@ test_that("AppenderFileRotatingTime: works with different backup_dir", {
339360 if (! is_zipcmd_available())
340361 skip(" Test requires a workings system zip command" )
341362
363+ assert_supported_rotor_version()
364+
342365 tf <- file.path(td , " test.log" )
343366 bu_dir <- file.path(td , " backups" )
344367
@@ -383,6 +406,9 @@ test_that("AppenderFileRotatingTime: works with different backup_dir", {
383406
384407
385408test_that(" AppenderFileRotatingTime: `size` and `age` arguments work as expected" , {
409+
410+
411+
386412 # setup
387413 tf <- file.path(td , " test.log" )
388414 app <- AppenderFileRotatingTime $ new(file = tf )$ set_age(- 1 )
0 commit comments