Skip to content
Example-driven consumer-driven contracts. For consumers.
Ruby Gherkin
Branch: master
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.
features
lib/shokkenki/consumer
spec
.gitignore
.rspec
.travis.yml
CHANGELOG.md
Gemfile
LICENSE.txt
README.md
Rakefile
shokkenki-consumer.gemspec

README.md

Shokkenki Consumer Build Status Code Climate

Allows consumers to specify consumer driven contracts using Shokkenki.

Consumer tests can express a contract as a series of HTTP interactions that can be used to stub out the provider in those tests. Those interactions can then be saved as a Shokkenki ticket and then used by Shokkenki Provider tests to ensure that a provider honours that contract.

Install

gem install shokkenki-consumer

Consumer Rspec

require 'shokkenki/consumer/rspec'
require_relative 'hungry_man'

Shokkenki.consumer.configure do
  define_provider :restaurant
end

describe HungryMan, :shokkenki_consumer do

  context 'when his ramen is hot' do

    before do
      order(:my_provider).during('order for ramen').to do
        get('/order/ramen').and_respond(:body => json('flavour' => /tasty/))
      end
    end

    it 'is happy' do
      expect(subject.happy?).to be_true
    end
  end
end

This example will stub the provider, allowing consumer specs to run. A ticket that serialises these interactions will be written to the default ticket location.

Documentation

Detailed documentation and examples for each feature can be found on the Shokkenki Consumer Relish Project.

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 Consumer Issues on Github. Have your say on the features that you want.

License

See LICENSE.txt.

You can’t perform that action at this time.