DiUS / pact-consumer-js-dsl

*DEPRECATED* A Javascript DSL for creating pacts, superceded by Pact JS
https://github.com/pact-foundation/pact-js
Other
56 stars 26 forks source link

Test Pact Term in request path #25

Closed bethesque closed 9 years ago

bethesque commented 9 years ago

@markdalgleish - I have updated the pact gems to allow a Pact::Term to be used in the path. This will require using version 0.2.3 of the pact-mock_service gem, along with the term() function described here: https://github.com/DiUS/pact-consumer-js-dsl/wiki/Flexible-matching

If you are using a standalone version of the mock service (I can't remember which one you were using) then we'll need to release a new package - can you let me know.

Warning: I have not tested this end to end with the javascript part yet, only the ruby part. But I have complete confidence...

mboudreau commented 9 years ago

@bethesque There's a problem with the term function shown in the wiki:

function term(term) {
  return {
    "json_class": "Pact::Term",
    "contents" : value,
    "data": {
      "generate": term.generate,
      "matcher": {
        "json_class": "Regexp",
        "o": 0,
        "s": term.matcher
      }
    }
  };
}

It's missing the variable 'value'. Also, I was wondering what would happen if you don't give the 'generate' property a value.

bethesque commented 9 years ago

Hm, I don't know what that value is. Delete it. Sorry, I didn't have time to test this. If you don't give it a generate, it will blow up at some stage in the mock service saying that the generate doesn't match the matcher.

mboudreau commented 9 years ago

@bethesque What's the next step for this one?

bethesque commented 9 years ago

This was just to get you to test it, which I believe you already have?

mboudreau commented 9 years ago

I have. Good to go :)

On Wed Feb 25 2015 at 17:03:53 Beth Skurrie notifications@github.com wrote:

This was just to get you to test it, which I believe you already have?

— Reply to this email directly or view it on GitHub https://github.com/DiUS/pact-consumer-js-dsl/issues/25#issuecomment-75910346 .