https://github.com/ike18t/wiremock_mapper
Ruby DSL for setting up WireMock mappings
https://github.com/ike18t/wiremock_mapper
ruby ruby-dsl ruby-gem stubbing wiremock
Last synced: about 2 months ago
JSON representation
Ruby DSL for setting up WireMock mappings
- Host: GitHub
- URL: https://github.com/ike18t/wiremock_mapper
- Owner: ike18t
- License: mit
- Created: 2016-07-12T22:39:44.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2023-09-16T19:02:39.000Z (about 2 years ago)
- Last Synced: 2025-07-30T06:12:06.108Z (2 months ago)
- Topics: ruby, ruby-dsl, ruby-gem, stubbing, wiremock
- Language: Ruby
- Homepage: http://www.rubydoc.info/gems/wiremock_mapper
- Size: 47.9 KB
- Stars: 6
- Watchers: 2
- Forks: 7
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
[](https://travis-ci.org/ike18t/wiremock_mapper)
[](https://codeclimate.com/github/ike18t/wiremock_mapper)
[](https://codeclimate.com/github/ike18t/wiremock_mapper/coverage)
[](https://gemnasium.com/github.com/ike18t/wiremock_mapper)
[](https://badge.fury.io/rb/wiremock_mapper)
[](http://inch-ci.org/github/ike18t/wiremock_mapper)##WireMockMapper
**Ruby DSL for setting up [WireMock](http://wiremock.org/) mappings**
####Documentation
Can be found at [RubyDoc.info](http://www.rubydoc.info/gems/wiremock_mapper)####Usage Example
```ruby
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)
endWireMockMapper.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](https://www.manheim.com)'s [Seller Tools](https://sites.google.com/site/sellertoolsteam/home) team for allowing me to work on this during the team Hackathon.