thoughtworks / pacto

Pacto settles disputes between JSON providers and consumers
thoughtworks.github.io/pacto
MIT License
400 stars 58 forks source link

contracts.validate_all yields NoMethodError #174

Open krobi64 opened 9 years ago

krobi64 commented 9 years ago

Hi guys,

I love the premise of this library. I want to first thank you for your effort to put something like this together. My company is standardizing on json-schema4. I've generated contracts that pass validation of the formatting and am trying to replicate the provider-side testing.

I am following the documentation samples which shows the following for 'Testing providers by simulating consumers' (running this in irb):

require 'pacto'

contracts = Pacto.load_contracts('contracts', 'https://api.github.com')
contracts.validate_all

This returns the following error:

NoMethodError: undefined method `validate_all' for #<Pacto::ContractSet:0x007f91d694a4c0>

I look at the code for ContractSet, and sure enough, there is not a validate_all method. In fact, grepping the entire project does not yield any reference to validate_all

What is the correct method for running validations for providers?

Thanks!

[EDIT]: I found the simulate_consumers method in ContractSet and am proceeding from here. The documentation should be updated, I will see if I can find it an submit a PR.

brunofracalossi commented 9 years ago

I guess that you can validate them using contracts.simulate_consumers

krobi64 commented 9 years ago

yes

Kris Robison | Principal Engineer

cell. 408.390.8107 email. kris.robison@oracle.com http://bluekai.com/ 20883 Stevens Creek Blvd, Suite 200 Cupertino, CA 95014

On Sep 10, 2015, at 6:39 AM, brunofracalossi notifications@github.com wrote:

I guess that you can validate them using contracts.simulate_consumers

— Reply to this email directly or view it on GitHub https://github.com/thoughtworks/pacto/issues/174#issuecomment-139237025.