Rambo
Rambo is a gem that generates API contract tests from API docs in RAML.
The current version of Rambo is 0.1.0. It is highly unstable and has a limited feature set. Use at your own risk and please file issue reports if they come up!
Usage
You can install Rambo using:
gem install rambo_ruby
You can also add it to your project's Gemfile: <
group :development, :test do
gem 'rambo_ruby', '~> 0.0.1'
end
To run Rambo, from the root directory of your project, run:
$ rambo .raml
Rambo will create spec/contract directory and a spec/rambo_helper.rb file if they don't exist, and will create a spec/contract/foobar_spec.rb file. The latter will overwrite any existing spec file by the same name. This is intentional behavior and will not change in future versions.
To run the RSpec examples Rambo generates, you will need to have requires in your spec_helper.rb or rambo_helper.rb file:
require "rack/test"require "json"require "json-schema"
Rambo is being developed to test APIs complying with standard REST practices. Mileage may vary with other architectures, but I'm happy to consider pull requests.
About the Project
I started Rambo in March of 2016 as part of my work at Renew Financial. RF has since put a second full-time engineer on the project. For this reason, our primary focus is on adding the features and functionality that are most important for testing RF's back-end services. One of these services, Repaymnt Estimatr, forms the basis for the Rambo MVP.
Although the Repaymnt Estimatr repo is private, the key technical considerations here are that it is built with Rails 4 and documented using RAML 1.0. Rambo, therefore, considers these the default, and support for other frameworks and for RAML 0.8 is incidental and lower priority. We would be delighted to merge pull requests adding such support, as long as they don't adversely affect the features we need most.
Although development of Rambo is largely supported by Renew Financial, we have every intention of keeping the tool open source and to continue expanding and updating its functionality.
Contributing
Rambo is a new project and any contributions are much appreciated. All pull requests should include comprehensive test coverage and, where appropriate, documentation. If you're not sure where to get started, contact me through Github and I'll be glad to chat.
Additional information for contributors is available in the wiki. Beginning or first-time contributors are welcome and encouraged!
More Information
- RAML homepage
- Roy Fielding's dissertation describing Representational State Transfer (REST) architecture
- RESTful Web Services, by Leonard Richardson & Sam Ruby
- Toby Clemson on testing microservices