Skip to content

ike18t/wiremock_mapper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

05e2b7c · Sep 16, 2023

History

67 Commits
Sep 15, 2023
Aug 30, 2023
Jun 3, 2019
Nov 4, 2022
Oct 19, 2017
Jun 3, 2019
Jul 12, 2016
Jul 12, 2016
Jul 29, 2016
Nov 4, 2022
Sep 16, 2023

Repository files navigation

Build Status Code Climate Test Coverage Dependency Status Gem Version Documentation

##WireMockMapper

Ruby DSL for setting up WireMock mappings

####Documentation Can be found at RubyDoc.info

####Usage Example

WireMockMapper::Configuration.set_wiremock_url('http://my_wiremock.com')

WireMockMapper::Configuration.create_global_mapping do |request, respond|
  request.with_header('Some-Header').equal_to('some_value')
         .with_cookie('Some-Cookie').not_matching('some_cookie_value')
  respond.with_status(200)
end

WireMockMapper.create_mapping do |request, respond|
  request.is_a_post
         .with_url_path.equal_to('path/to/stub')
         .with_header('Some-Other-Header').equal_to('some_other_value')
         .with_cookie('Some-Other-Cookie').containing('some_other_cookie_value')
         .with_body.equal_to(foo: bar)
  respond.with_body('good job!')
end
Special thanks to Manheim's Seller Tools team for allowing me to work on this during the team Hackathon.