Logo: Relish

  1. Sign in

Project: Shokkenki-provider 1.2

Shokkenki-provider 1.2

Allows providers to redeem (verify) Shokkenki consumer-driven contracts.

Providers can redeem a ticket generated by Shokkenki Consumer to verify that they adhere to the contract specified by a consumer.

Redeeming a ticket involves generating and running a series of RSpec examples that test each interaction specified against the provider.

Install

gem install shokkenki-provider

Provider Rspec

require 'shokkenki/provider/rspec'

class Restaurant
  def call env
    env['PATH_INFO'] == '/order/ramen' ? [200, {}, ['a tasty morsel']] : raise('Unsupported path')
  end
end

Shokkenki.provider.configure do
  provider(:restaurant) { run Restaurant.new }
end

Shokkenki.provider.redeem_tickets

When run, this example will define and run an RSpec specification:

Hungry Man
  order for ramen
    body
      json
        $.flavour
          matches /tasty/

Need help?

Try the Shokkenki Google Group (you must be a member to post).

Bugs or Feature Requests for the Project/Documentation?

Please use Shokkenki Provider Issues on Github. Have your say on the features that you want.

Code

Shokkenki Provider on Github.

Topics

  1. Configuration
  2. Running
  3. Troubleshooting

Last published over 3 years ago by brentsnook.