thoughtbot / cocaine

A small library for doing (command) lines.
https://robots.thoughtbot.com
Other
785 stars 55 forks source link

Documentation on usage during testing (how-to mock, etc) #64

Closed onyxraven closed 9 years ago

onyxraven commented 10 years ago

I'm looking for some guidance on how best to test usage of cocaine in specs...

Mainly, I've got some calls that call multiple command line functions in a row. Usually the spec runs fine, but sometimes (especially under guard/drb) the cocaine dummy backend seems to get lost and it fails because it is trying to run commands that don't work in tests.

I've mostly figured out how to mock/expect around a single call, but I'm having trouble when expecting multiple calls.

Thanks.

jyurek commented 10 years ago

Can you give an example of a command that fails using the FakeRunner? I think finding why that fails would be more fruitful than trying to stub Cocaine directly.

jyurek commented 9 years ago

Since this is such an old issue with no activity, I'm going to close it. Please let me know if anything's changed for you. Thanks.