Releases: ropensci/webmockr
Releases · ropensci/webmockr
webmockr v0.6.0
NEW FEATURES
- new
Adapterclass to consolidate common code for theHttrAdapterandCrulAdapterclasses, which inherit fromAdapter; not a user facing change (#87) - pkgdown documentation site gains grouping of functions to help the user navigate the package: see https://docs.ropensci.org/webmockr/reference/ (#93)
MINOR IMPROVEMENTS
- now correctly fails with informative message when
write_disk_pathisNULLwhen the user is trying to write to disk while using webmockr (#78) - improve README construction; use html child for the details section (#81)
- fix matching stub matching for bodies when bodies are JSON encoded (#82)
- when vcr was loaded real HTTP requests were being performed twice when they should have only been performed once (#91) (#92)
BUG FIXES
- fix for
set_body()method in theResponseclass - handle cases where user writing to disk and not, and handle raw bytes correctly (#80) - fix to
to_s()method inStubbedRequestclass - was formatting query parameters incorrectly (#83) - fix to
BodyPatternclass to handle upload objects in a list; related issue fixed wherewi_th()parameterbodywas not handling upload objects (#84) (#85) - httr requests were failing when vcr loaded, but with no cassette inserted; fixed
handle_request()to skip vcr-related code unless a cassette is inserted (#86) (#88)
webmockr v0.5.0
NEW FEATURES
webmockrnow supports mocking writing to disk. TLDR: see?mocking-disk-writingto get started - That is, both of the major high level http clients in R, crul and httr, support writing directly to disk (rather than the user manually getting the http response and writing it to disk). supporting this required quite a bit of work, both in code and in thinking about how to support the various scenarios in which users can find themselves when dealing with writing to disk - Please get in touch if you have problems with this (#57) (#76)- gains
request_registry_clear()method to easily clear all requests in the request registry (#75)
MINOR IMPROVEMENTS
- better docs for R6 classes with R6 support in new roxygen2 version on cran (#77)
- httr simple auth was being ignored - its now supported (simple auth with crul already worked) (#74)
BUG FIXES
- fix to handle raw responses that can not be converted to character, such as images; needed due to issue ropensci/vcr#112 (#72) (#73)
webmockr v0.4.0
MINOR IMPROVEMENTS
- fix link to http testing book, change ropensci to ropenscilabs (#67)
- fixes to request matching: single match types working now (e.g., just match on query, or just on headers); in addition, header matching now works; added examples of single match types (#68) (#69)
BUG FIXES
- fix stub specification within crul and httr adapters; typo in setting headers (#70)
webmockr v0.3.4
DEFUNCT
NEW FEATURES
MINOR IMPROVEMENTS
- typo fixes (#62) thanks @Bisaloo !
- improved the print method for stubs, found in
StubbedRequest, to have better behavior for very long strings such as in headers and bodies (#63)
BUG FIXES
- fix date in mocked
httrresponse object to match the date format thathttruses in real HTTP requests (#58) (#61) via ropensci/vcr#91 - fix response headers in mocked
httrresponse objects.httrmakes the list of headers insensitive to case, so we now use that function from the package (#59) (#61) to_return()andwi_th()drop use of thelazyevalpackage and fall back to using the simplelist(...)- fixes problem where creating stubs was failing withintest_that()blocks due to some weird lazy eval conflicts (i think) (#60) (#64) thanks @karawoo !
webmockr v0.3.0
MINOR IMPROVEMENTS
- returned mocked response headers were retaining case that the user gave - whereas they should be all lowercased to match the output in
crulandhttr. now fixed. (#49) thanks @hlapp - returned mocked response headers were not all of character class, but depended on what class was given by the user on creating the stub. this is now fixed, returning all character class values for response headers (#48) thanks @hlapp
- skip tests that require
vcrifvcris not available (#53) - internal change to crul adapter to produce the same http response as a new version of crul returns - adds a
response_headers_allslot (#51) (#54)
webmockr v0.2.9
MINOR IMPROVEMENTS
- make
request_registry()andstub_registry()print methods more similar to avoid confusion for users (#35) - update docs for
enable/disableto indicate thatcrulandhttrsupported (#46) (related to #45) - wrap httr adapter examples in
requireNamespaceso only run when httr available - clean up
.onLoadcall, removing commented out code, and add note about creating adapter objects does not load crul and httr packages
BUG FIXES
- fix to
enable()anddisable()methods. even thoughhttris in Suggests, we were loading all adapters (crul, httr) withstopwhen the package was not found. We now give a message and skip when a package not installed. In addition, weenable()anddisable()gain anadapterparameter to indicate which package you want to enable or disable. Ifadapternot given we attempt all adapters. Note that this bug shouldn't have affectedvcrusers ashttris in Imports in that package, so you'd have to havehttrinstalled (#45) thanks to @maelle for uncovering the problem
webmockr v0.2.8
NEW FEATURES
- Added support for integration with package
httr; seeHttrAdapterfor the details;webmockrnow integrates with two HTTP R packages:crulandhttr(#43) (#44) - Along with
httrintegration is a new methodhttr_mock()to turn on mocking forhttr; and two methodsbuild_httr_responseandbuild_httr_requestmeant for internal use
webmockr v0.2.6
NEW FEATURES
- Added support for integration with package
vcr(now on CRAN) for doing HTTP request caching
webmockr v0.2.4
NEW FEATURES
- New function
enabled()to ask ifwebmockris enabled, gives a
boolean wi_th()gains new parameter.listas an escape hatch to avoid
NSE. examples added in thewi_thman file to clarify its use
MINOR IMPROVEMENTS
- matching by request body was not supported, it now is; added examples
of matching on request body, see?stub_request(#36) - make sure that the adapter for
crulhandles all types of matches (#29) - removed all internal usage of pipes in the package. still exporting
pipe for users (#30) - fixed internals to give vcr error when vcr loaded - for future release
with vcr support (#34) - require newest
crulversion
BUG FIXES
- Error messages with the suggest stub were not giving bodies. They
now give bodies if needed along with method, uri, headers, query (#37) - Fixed
Responseclass that was not dealing with capitalization
correctly
webmockr v0.2.0
NEW FEATURES
- New function
to_raise()to say that a matched response should return a certain exception, currentlyto_raiseaccepts error classes from thefauxpaspackage (#9) - New function
to_timeout()to say that a matched response should return a timeout. This is a special case ofto_raiseto easily do a timeout expectation (#11) - New function
request_registry()to list requests in the request registry (#23) - package
crulmoved to Imports from Suggests as it's the only http client supported for now. will move back to Suggests once we support at least one other http client webmockr_configure()changes:turn_onhas been removed;allow_net_connectandallow_localhostwere ignored before, but are now used and are now set toFALSEby default; fixed usage ofallowwhich now accepts character vector of URLs instead of a boolean; the following correctly marked as being ignored for now until fixednet_http_connect_on_start,show_stubbing_instructions,query_values_notation,show_body_diff(#19) (#21)webmockr_disable_net_connect()now accepts anallowparameter to disable all other connections except those URLs given inallowwebmockr_net_connect_allowed()now accepts auriparameter to test if a URI/URL is allowed
MINOR IMPROVEMENTS
- Fixed printed stub statement when printed to the console - we weren't including headers accurately (#18)
- Added examples to the
stub_registry()andstub_registry_clea()manual files (#24) - internal methods
build_crul_requestandbuild_crul_responsemoved outside of theCrulAdapterclass so that they can be accesed likewebmockr::in other packages enable()anddisable()now return booleans invisibly- General improvements to documentation throughout
- Added linting of user inputs to the
to_return()method, and docs details on what to input to the method - Added linting of user inputs to the
wi_th()method, and docs details on what to input to the method
BUG FIXES
- Fixed option
allow_localhost, which wasn't actually workin before (#25)
DEPRECATED AND DEFUNCT
webmockr_enable()andwebmockr_disableare now defunct. Usewebmockr::enable()andwebmockr::disable()instead