Running ‘testthat.R’ [1s/2s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > library(refimpact)
  refimpact: API wrapper for the UK REF 2014 Impact Case Studies Database.
  Run ?refimpact for help, or see the vignette.
  > 
  > test_check("refimpact")
  ── 1. Error: api_method value of ListTagValues gives no error if tag_value is
    
  Failed to connect to impact.ref.ac.uk port 80: Connection refused
  1: expect_silent(ListTagValues_validate("ListTagValues", 5)) at testthat/test_input_validation.R:22
  2: quasi_capture(enquo(object), evaluate_promise)
  3: capture(act$val <- eval_bare(get_expr(quo), get_env(quo)))
  4: withr::with_output_sink(temp, withCallingHandlers(withVisible(code), warning = handle_warning, 
         message = handle_message))
  5: force(code)
  6: withCallingHandlers(withVisible(code), warning = handle_warning, message = handle_message)
  7: withVisible(code)
  8: eval_bare(get_expr(quo), get_env(quo))
  9: ListTagValues_validate("ListTagValues", 5)
  10: ref_get("ListTagTypes")
  11: httr::GET(api_url, ua)
  12: request_perform(req, hu$handle$handle)
  13: request_fetch(req$output, req$url, handle)
  14: request_fetch.write_memory(req$output, req$url, handle)
  15: curl::curl_fetch_memory(url, handle = handle)
  
  ── 2. Failure: useful error if unseen tag_value is provided to ListTagValues (@t
  `ListTagValues_validate("ListTagValues", 2)` threw an error with unexpected message.
  Expected match: "*tag_type*"
  Actual message: "Failed to connect to impact.ref.ac.uk port 80: Connection refused"
  
  ── 3. Error: list elements with acceptable names and parameters throw no error o
  Failed to connect to impact.ref.ac.uk port 80: Connection refused
  1: expect_silent(SearchCaseStudies_prepare(list(UKPRN = 10007777))) at testthat/test_input_validation.R:65
  2: quasi_capture(enquo(object), evaluate_promise)
  3: capture(act$val <- eval_bare(get_expr(quo), get_env(quo)))
  4: withr::with_output_sink(temp, withCallingHandlers(withVisible(code), warning = handle_warning, 
         message = handle_message))
  5: force(code)
  6: withCallingHandlers(withVisible(code), warning = handle_warning, message = handle_message)
  7: withVisible(code)
  8: eval_bare(get_expr(quo), get_env(quo))
  9: SearchCaseStudies_prepare(list(UKPRN = 10007777))
  10: ref_get("ListInstitutions")
  11: httr::GET(api_url, ua)
  12: request_perform(req, hu$handle$handle)
  13: request_fetch(req$output, req$url, handle)
  14: request_fetch.write_memory(req$output, req$url, handle)
  15: curl::curl_fetch_memory(url, handle = handle)
  
  ── 4. Failure: unseen UKPRNs throw an error (@test_input_validation.R#79)  ─────
  `SearchCaseStudies_prepare(list(UKPRN = 1))` threw an error with unexpected message.
  Expected match: "UKPRN"
  Actual message: "Failed to connect to impact.ref.ac.uk port 80: Connection refused"
  
  ── 5. Failure: unseen UKPRNs throw an error (@test_input_validation.R#80)  ─────
  `SearchCaseStudies_prepare(list(UKPRN = 1.5))` threw an error with unexpected message.
  Expected match: "UKPRN"
  Actual message: "Failed to connect to impact.ref.ac.uk port 80: Connection refused"
  
  ── 6. Failure: unseen UKPRNs throw an error (@test_input_validation.R#81)  ─────
  `SearchCaseStudies_prepare(list(UKPRN = "hello"))` threw an error with unexpected message.
  Expected match: "UKPRN"
  Actual message: "Failed to connect to impact.ref.ac.uk port 80: Connection refused"
  
  ── 7. Failure: unseen UOAs throw an error (@test_input_validation.R#85)  ───────
  `SearchCaseStudies_prepare(list(UoA = 1e+07))` threw an error with unexpected message.
  Expected match: "UoA"
  Actual message: "Failed to connect to impact.ref.ac.uk port 80: Connection refused"
  
  ── 8. Failure: unseen UOAs throw an error (@test_input_validation.R#86)  ───────
  `SearchCaseStudies_prepare(list(UoA = 1.5))` threw an error with unexpected message.
  Expected match: "UoA"
  Actual message: "Failed to connect to impact.ref.ac.uk port 80: Connection refused"
  
  ── 9. Failure: unseen UOAs throw an error (@test_input_validation.R#87)  ───────
  `SearchCaseStudies_prepare(list(UoA = "hello"))` threw an error with unexpected message.
  Expected match: "UoA"
  Actual message: "Failed to connect to impact.ref.ac.uk port 80: Connection refused"
  
  ══ testthat results  ═══════════════════════════════════════════════════════════
  OK: 40 SKIPPED: 7 FAILED: 9
  1. Error: api_method value of ListTagValues gives no error if tag_value is
            provided (@test_input_validation.R#22) 
  2. Failure: useful error if unseen tag_value is provided to ListTagValues (@test_input_validation.R#31) 
  3. Error: list elements with acceptable names and parameters throw no error or
            warning (@test_input_validation.R#65) 
  4. Failure: unseen UKPRNs throw an error (@test_input_validation.R#79) 
  5. Failure: unseen UKPRNs throw an error (@test_input_validation.R#80) 
  6. Failure: unseen UKPRNs throw an error (@test_input_validation.R#81) 
  7. Failure: unseen UOAs throw an error (@test_input_validation.R#85) 
  8. Failure: unseen UOAs throw an error (@test_input_validation.R#86) 
  9. Failure: unseen UOAs throw an error (@test_input_validation.R#87) 
  
  Error: testthat unit tests failed
  Execution halted