Skip to content

Commit

Permalink
Fix closing of connection in fake_request
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasp85 committed Nov 12, 2018
1 parent 18a9d63 commit c69c053
Show file tree
Hide file tree
Showing 10 changed files with 54 additions and 21 deletions.
3 changes: 2 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Description: In order to facilitate parsing of http requests and creating
builds upon the 'rook' specification and is thus well suited to be combined
with 'httpuv' based web servers.
License: MIT + file LICENSE
Encoding: UTF-8
LazyData: TRUE
Depends: R (>= 2.10)
Imports: R6,
Expand All @@ -27,7 +28,7 @@ Imports: R6,
xml2,
webutils,
utils
RoxygenNote: 6.0.1.9000
RoxygenNote: 6.1.0
Roxygen: list(markdown = TRUE)
Suggests: fiery,
testthat,
Expand Down
6 changes: 5 additions & 1 deletion R/formatters.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#' to their respective formatters
#'
#' @examples
#' fake_rook <- test <- fiery::fake_request(
#' fake_rook <- fiery::fake_request(
#' 'http://example.com/test',
#' content = '',
#' headers = list(
Expand All @@ -28,6 +28,10 @@
#' res$format(json = format_json(), csv = format_table(sep=','))
#' res$body
#'
#' # Cleaning up connections
#' rm(fake_rook, req, res)
#' gc()
#'
NULL

#' @rdname formatters
Expand Down
6 changes: 5 additions & 1 deletion R/parsers.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#' to their respective parsers
#'
#' @examples
#' fake_rook <- test <- fiery::fake_request(
#' fake_rook <- fiery::fake_request(
#' 'http://example.com/test',
#' content = '[1, 2, 3, 4]',
#' headers = list(
Expand All @@ -25,6 +25,10 @@
#' req$parse(json = parse_json())
#' req$body
#'
#' # Cleaning up connections
#' rm(fake_rook, req)
#' gc()
#'
NULL

#' @rdname parsers
Expand Down
6 changes: 5 additions & 1 deletion R/request.R
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@
#' @export
#'
#' @examples
#' fake_rook <- test <- fiery::fake_request(
#' fake_rook <- fiery::fake_request(
#' 'http://example.com/test?id=34632&question=who+is+hadley',
#' content = 'This is an elaborate ruse',
#' headers = list(
Expand All @@ -166,6 +166,10 @@
#' # Perform content negotiation for the response
#' req$accepts(c('html', 'json', 'txt'))
#'
#' # Cleaning up connections
#' rm(fake_rook, req)
#' gc()
#'
Request <- R6Class('Request',
public = list(
initialize = function(rook, trust = FALSE) {
Expand Down
6 changes: 5 additions & 1 deletion R/response.R
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@
#' @export
#'
#' @examples
#' fake_rook <- test <- fiery::fake_request(
#' fake_rook <- fiery::fake_request(
#' 'http://example.com/test?id=34632&question=who+is+hadley',
#' content = 'This is elaborate ruse',
#' headers = list(
Expand All @@ -180,6 +180,10 @@
#' res$body
#' res$get_header('Content-Disposition')
#'
#' # Cleaning up connections
#' rm(fake_rook, req, res)
#' gc()
#'
Response <- R6Class('Response',
public = list(
# Methods
Expand Down
6 changes: 5 additions & 1 deletion man/Request.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 6 additions & 2 deletions man/Response.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 9 additions & 5 deletions man/formatters.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 7 additions & 3 deletions man/parsers.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions man/reqres-package.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit c69c053

Please sign in to comment.