Giter VIP home page Giter VIP logo

pact-ruby-demo's Introduction

pact-ruby-demo

Demo repo for Consumer Driven Contract Tests using Pact

A proof of concept of Consumer Driven Contract Testing for a message based (non-HTTP) producer and consumer relationship using the pact-message-ruby gem.

Pact already supports non-HTTP interactions and contracts in most languages. An official pact-message-ruby gem has existed for several years.

Scenario

This POC focuses on a hypothetical situation where a potential breaking change has been introduced to a message schema.

The consumer is expecting a message containing a last_name field, however this field has been renamed. The producer is now sending messages with a surname field.

Usage

Running consumer side tests and generating a contract

  1. Execute the consumer side test for the TestMessageConsumer.

bundle exec rspec

  1. The consumer side test should pass.
  2. A contract file will be created representing the consumers expectations of the message format.

Running provider side verification of the contract

  1. Execute the Pact verification Rake task.

bundle exec rake pact:verify

  1. The RSpec tests generated by the Pact provider side verification task should fail.

pact-ruby-demo's People

Contributors

andrewjanuary avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Forkers

mifrill safdotdev

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.