tests/testthat/test-rescale_political_interest.R

library (surveyreader)
library(testthat)
context("Wrapper for direction of country/EU question.")

test_that("correct conversion takes place", {
  expect_equal(rescale_political_interest  (
    column = c("Moderately interested in politics",
               "Strongly interested in politics"),
    from  = c("Not at all interested in politics",
              "Slightly interested in politics",
              "Moderately interested in politics",
              "Strongly interested in politics"),
    to = c(0,0,0,1)),
    factor( c(0,1), levels = c(0,1))
  )
})
antaldaniel/surveyreader documentation built on May 16, 2019, 2:29 a.m.