Ruby Hooks Handler for Dredd API Testing Framework
Test your api with Dredd API testing framework and write hooks in Ruby to glue together API Blueprint with your Ruby project.
Installation
Add this line to your application's Gemfile:
gem 'dredd_worker'
And then execute:
$ bundle
Or install it yourself as:
$ gem install dredd_hooks
Usage
- Create a hook file in
hooks.rb
:
include DreddHooks::Methods
before "Machines > Machines collection > Get Machines" do |transaction|
transaction['skip'] = "true"
end
- Run it with Dredd
$ dredd apiary.apib localhost:3000 --language ruby --hookfiles hooks.rb
API
Module DreddHooks::Methods
mixes in following methods before
, after
, before_all
, after_all
, before_each
, after_each
, before_validation
, before_each_validation
before
, before_validation
after
hooks are identified by transaction name.
Usage is very similar to sync JS hooks API
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request