{"id":15430958,"url":"https://github.com/gonzalo-bulnes/dredd-rack","last_synced_at":"2025-08-20T18:32:14.337Z","repository":{"id":27901744,"uuid":"31393425","full_name":"gonzalo-bulnes/dredd-rack","owner":"gonzalo-bulnes","description":"The Dredd API blueprint testing tool for your Rack applications.","archived":false,"fork":false,"pushed_at":"2021-05-20T09:01:12.000Z","size":129,"stargazers_count":49,"open_issues_count":3,"forks_count":14,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-12-13T12:13:49.023Z","etag":null,"topics":["api-blueprint","dredd","dredd-hooks","rack","rails","ruby","testing-tools"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gonzalo-bulnes.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-02-26T23:00:59.000Z","updated_at":"2024-11-28T16:30:42.000Z","dependencies_parsed_at":"2022-09-04T04:42:00.853Z","dependency_job_id":null,"html_url":"https://github.com/gonzalo-bulnes/dredd-rack","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gonzalo-bulnes%2Fdredd-rack","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gonzalo-bulnes%2Fdredd-rack/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gonzalo-bulnes%2Fdredd-rack/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gonzalo-bulnes%2Fdredd-rack/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gonzalo-bulnes","download_url":"https://codeload.github.com/gonzalo-bulnes/dredd-rack/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230445926,"owners_count":18227060,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api-blueprint","dredd","dredd-hooks","rack","rails","ruby","testing-tools"],"created_at":"2024-10-01T18:19:42.113Z","updated_at":"2024-12-19T14:06:47.732Z","avatar_url":"https://github.com/gonzalo-bulnes.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"Dredd::Rack\n===========\n\n[![Gem Version](https://badge.fury.io/rb/dredd-rack.svg)](http://badge.fury.io/rb/dredd-rack)\n[![Build Status](https://travis-ci.org/gonzalo-bulnes/dredd-rack.svg?branch=master)](https://travis-ci.org/gonzalo-bulnes/dredd-rack)\n[![Code Climate](https://codeclimate.com/github/gonzalo-bulnes/dredd-rack.svg)](https://codeclimate.com/github/gonzalo-bulnes/dredd-rack)\n[![Dredd Reference Version](https://img.shields.io/badge/dredd_reference_version-2.2.5-brightgreen.svg)](https://github.com/apiaryio/dredd)\n[![Inline docs](http://inch-ci.org/github/gonzalo-bulnes/dredd-rack.svg?branch=master)](http://inch-ci.org/github/gonzalo-bulnes/dredd-rack)\n\nThis gem provides a [Dredd][dredd] runner and a `dredd` rake task to make [API blueprint][blueprint] testing convenient for Rack applications. When verifying blueprints locally, an application server is automatically set up, without need of any manual intervention.\n\nBesides being convenient, that allows to use the API blueprints as acceptance test suites to practice [BDD][rspec-book] with Dredd and RSpec, for example, while clients developers use [Apiary][apiary] as a mock server.\n\n  [dredd]: https://github.com/apiaryio/dredd\n  [blueprint]: https://apiblueprint.org/\n  [rspec-book]: https://pragprog.com/book/achbd/the-rspec-book\n  [apiary]: http://apiary.io\n  [issues]: https://github.com/gonzalo-bulnes/dredd-rack/issues\n  [gonzalo-bulnes]: https://github.com/gonzalo-bulnes\n\nInstallation\n------------\n\nAdd the gem to your `Gemfile`:\n\n```ruby\n# Gemfile\n\ngem 'dredd-rack', '~\u003e 1.0' # see semver.org\n```\n\nDefine which application Dredd::Rack must serve automatically:\n\n```ruby\n# config/initializers/dredd-rack.rb or app.rb or Rakefile\n\nrequire 'dredd/rack'\n\nDredd::Rack.configure do |config|\n  # Allow the automatic setup of a local application server when necessary\n  #\n  # Find the name of your application in its `config.ru` file.\n  config.app = Example::Application # or Rails.application, Sinatra::Application...\n\n  # Optionally, you can define a custom Dredd command:\n  config.dredd_command = 'dredd'\nend\n\n```\n\nUsage\n-----\n\n### Getting started\n\nDefine the `dredd` rake task in your `Rakefile`:\n\n```ruby\n# Rakefile\n\nrequire 'dredd/rack'\n\n# ...\n\n# Define the :dredd task\nDredd::Rack::RakeTask.new # run: `dredd doc/*.apib doc/*.apib.md \u003clocal or remote URL\u003e`\n\n# Optionally add the API blueprint verification to the default test suite\n# task :default =\u003e [:spec, :dredd]\n```\n\nRun the API blueprint verification:\n\n```bash\n# locally\nrake dredd\n\n# or specify a remote server:\n#API_HOST=http://api.example.com rake dredd\n```\n\nThe `:dredd` rake task requires no further configuration. However, it relies on the following convention: API blueprints must be stored in the `doc` directory with either the `.apib` or the `.apib.md` extension.\n\n### Further usage\n\nOf course you can define your own rake tasks with custom runners!\n\nEach Dredd::Rack runner stores a specific Dredd configuration. In order to manage different runners, you can define multiple rake tasks with custom names or descriptions:\n\n```ruby\n# Rakefile\n\n# ...\n\nnamespace :blueprint do\n  namespace :verify do\n\n    desc 'Verify the whole API compliance with its blueprint'\n    Dredd::Rack::RakeTask.new(:all)\n\n    desc 'Verify the Machines API compliance with its blueprint'\n    Dredd::Rack::RakeTask.new(:machines) do |task|\n      task.runner.configure do |dredd|\n        dredd.only 'Machines \u003e Machines Collection \u003e List all Machines',\n                   'Machines \u003e Machine \u003e Retrieve a Machine' # etc.\n        dredd.sorted!.details!\n      end\n    end\n\n    # ...\n  end\nend\n\n# run with `rake blueprint:verify:all` and `rake blueprint:verify:machines`\n```\n\nBoth the [rake task documentation][rake-task-doc] and the [runner documentation][runner-doc] contain more examples, and the runner documentation does also contain a comprehensive list of the [configuration methods][conf] that can be used to customize runners. Take a look at them!\n\n  [rake-task-doc]: doc/rake_task.md\n  [runner-doc]: doc/runner.md\n  [conf]: doc/runner.md#configuration-methods-reference\n\n\n#### Remote API testing\n\nConfiguring a runner for remote API blueprint compliance testing is as easy as setting its **api_endpoint** option (see the [runner documentation][conf]). Please remember that you must ensure that the API is being served at the specified URI when performing remote API blueprint validation.\n\nDevelopment\n-----------\n\n### Testing and documentation\n\n\nThis gem behaviour is described using [RSpec][rspec] and RSpec [tags][tags] are used to categorize the spec examples.\n\nSpec examples that are tagged as `public` describe aspects of the gem public API, and MAY be considered as the gem documentation.\n\nThe `private` or `protected` specs are written for development purpose only. Because they describe internal behaviour which may change at any moment without notice, they are only executed as a secondary task by the [continuous integration service][travis] and SHOULD be ignored.\n\nRun `rake spec:public` to print the gem public documentation.\n\n  [rspec]: https://www.relishapp.com/rspec/rspec-rails/docs\n  [tags]: https://www.relishapp.com/rspec/rspec-core/v/3-1/docs/command-line/tag-option\n  [travis]: https://travis-ci.org/gonzalo-bulnes/dredd-rack/builds\n\nContributions\n-------------\n\nContributions are welcome! The best way to get in touch is probably to open an issue, whether it is to get help, give feedback or discuss an idea. Also, when there are plan to extend Dredd::Rack, the [intended API][intended] is [described beforehand so we can discuss it][rdd]. Feel free to jump into the discussion at any moment!\n\nNote that opening pull requests with work in progress is not only welcome, but encouraged! Let's talk early, talk often, and we will all learn in the way :)\n\nPlease note that Dredd::Rack is released with a [Contributor Code of Conduct][coc]. By participating in this project you agree to abide by its terms.\n\n  [rdd]: http://tom.preston-werner.com/2010/08/23/readme-driven-development.html\n  [intended]: ./doc/README.md\n  [coc]: ./CODE_OF_CONDUCT.md\n\nCredits\n-------\n\nThe `Dredd::Rack::RakeTask` is heavily inspired in the [`RSpec::Core::RakeTask`][rspec-core-raketask]. Let the corresponding credits go to the RSpec team.\n\n  [rspec-core-raketask]: https://github.com/rspec/rspec-core/blob/v3.2.1/lib/rspec/core/rake_task.rb\n\nLicense\n-------\n\n    Dredd::Rack provides convenient API blueprint testing to Rack applications.\n    Copyright (C) 2015, 2016  Gonzalo Bulnes Guilpain\n\n    Copyright (C) 2012 Chad Humphries, David Chelimsky, Myron Marston\n    Copyright (C) 2009 Chad Humphries, David Chelimsky\n    Copyright (C) 2006 David Chelimsky, The RSpec Development Team\n    Copyright (C) 2005 Steven Baker\n\n    This program is free software: you can redistribute it and/or modify\n    it under the terms of the GNU General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    This program is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU General Public License for more details.\n\n    You should have received a copy of the GNU General Public License\n    along with this program.  If not, see \u003chttp://www.gnu.org/licenses/\u003e.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgonzalo-bulnes%2Fdredd-rack","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgonzalo-bulnes%2Fdredd-rack","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgonzalo-bulnes%2Fdredd-rack/lists"}