expect_reactivity: Expectation: is the counter equal to a value?

Description Usage Arguments Value Examples

View source: R/expect.R

Description

Compares the maximum counter value of a tag in a whereami counter object with a value

Usage

1
expect_reactivity(object, tag, count)

Arguments

object

whereami counter object read from whereami.json

tag

character, tag name of the element in the counter object to query

count

numeric, expected value

Value

invisible result

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
if(interactive()){

txt <- "
whereami::cat_where(whereami::whereami(tag = 'reactor test'))
"

whereami::set_whereami_log(tempdir())

tf <- tempfile(fileext = '.R')

cat(txt,file = tf)

source(tf)

counter <- read_reactor(path = tempdir())

expect_reactivity(counter,'reactor test',1)

# clean up temp files

whereami::counter_reset()
unlink(tf)
unlink(reactor_dir, recursive = TRUE, force = TRUE)

}

yonicd/reactor documentation built on Oct. 12, 2020, 3:20 a.m.