No description, website, or topics provided.
Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
bin Unarchiving repo Sep 17, 2018
lib/apib Unarchiving repo Sep 17, 2018
test Unarchiving repo Sep 17, 2018
.gitignore Unarchiving repo Sep 17, 2018
.rubocop.yml Unarchiving repo Sep 17, 2018
.travis.yml Unarchiving repo Sep 17, 2018
Gemfile Unarchiving repo Sep 17, 2018
LICENSE.txt Unarchiving repo Sep 17, 2018
README.md Unarchiving repo Sep 17, 2018
Rakefile Unarchiving repo Sep 17, 2018
apib-mock_server.gemspec Unarchiving repo Sep 17, 2018

README.md

Apib::MockServer

Build Status

A simple Rack compatible mock server, based on an API Blueprint document.

Installation

Add this line to your application's Gemfile:

gem "apib-mock_server"

And then execute:

$ bundle

Or install it yourself as:

$ gem install apib-mock_server

Usage

require "apib/mock_server"
require "webmock"
base_url = "http://test.com"
blueprint = File.read("my.apib")
app = Apib::MockServer.new(base_url, blueprint)
WebMock::StubRegistry.instance.register_request_stub(
  WebMock::RequestStub.new(:any, /#{base_url}/)
).to_rack(app)

Development

After checking out the repo, run bin/setup to install dependencies. Then, run rake test to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and tags, and push the .gem file to rubygems.org.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/karnov/apib-mock_server.

License

The gem is available as open source under the terms of the MIT License.