matt.fellows
2018-04-03 22:39
For some reason though, the `--pact-dir` argument doesn?t like certain paths. e.g. this fails:
```
pact-message update '{"content":{"access":{"contents":{"role":{"data":{"generate":"admin","matcher":{"json_class":"Regexp","o":0,"s":"admin|controller|user"}},"json_class":"Pact::Term"}},"json_class":"Pact::ArrayLike","min":3},"id":{"contents":127,"json_class":"Pact::SomethingLike"},"name":"Baz"},"providerState":"some state","metadata":{"Content-Type":"application/json; charset=utf-8"},"description":"some test case"}' --consumer billy --provider bobby --pact-dir /Users/mfellows/go/src/github.com/pact-foundation/pact-go/examples/pacts/
/opt/pact/lib/vendor/ruby/2.2.0/gems/pact-message-0.4.0/lib/pact/message/consumer/interaction_decorator.rb:36:in `extract_content': undefined method `content' for #<Pact::Interaction:0x007ff211a27000> (NoMethodError)
from /opt/pact/lib/vendor/ruby/2.2.0/gems/pact-message-0.4.0/lib/pact/message/consumer/interaction_decorator.rb:18:in `as_json'
from /opt/pact/lib/vendor/ruby/2.2.0/gems/pact-message-0.4.0/lib/pact/message/consumer/consumer_contract_decorator.rb:14:in `block in as_json'
from /opt/pact/lib/vendor/ruby/2.2.0/gems/pact-message-0.4.0/lib/pact/message/consumer/consumer_contract_decorator.rb:14:in `collect'
from /opt/pact/lib/vendor/ruby/2.2.0/gems/pact-message-0.4.0/lib/pact/message/consumer/consumer_contract_decorator.rb:14:in `as_json'
from /opt/pact/lib/vendor/ruby/2.2.0/gems/pact-mock_service-2.6.4/lib/pact/consumer_contract/consumer_contract_decorator.rb:28:in `to_json'
from /opt/pact/lib/vendor/ruby/2.2.0/gems/json-2.1.0/lib/json/common.rb:286:in `generate'
from /opt/pact/lib/vendor/ruby/2.2.0/gems/json-2.1.0/lib/json/common.rb:286:in `pretty_generate'
```
but this is totes fine:
```
pact-message update '{"content":{"access":{"contents":{"role":{"data":{"generate":"admin","matcher":{"json_class":"Regexp","o":0,"s":"admin|controller|user"}},"json_class":"Pact::Term"}},"json_class":"Pact::ArrayLike","min":3},"id":{"contents":127,"json_class":"Pact::SomethingLike"},"name":"Baz"},"providerState":"some state","metadata":{"Content-Type":"application/json; charset=utf-8"},"description":"some test case"}' --consumer billy --provider bobby --pact-dir /tmp/pacts
```