aruba
aruba copied to clipboard
Mocking HTTP requests without in-process feature
Summary
I have read that using in-process feature is one solution to be able to mock HTTP requests. https://github.com/erikhuda/thor/wiki/Integrating-with-Aruba-In-Process-Runs But as described in:
- https://github.com/cucumber/aruba/issues/199
- https://github.com/cucumber/aruba/pull/159 It is not possible to have both interactive CLI and use in-process feature.
Context & Motivation
I am using Thor on a gem that provides some commands to request information from a server. For example, when running a command I ask the user to choose between a set of servers available (thus interaction) and returns the requested information.
Current Behavior
To test my commands I tried using the in-process feature as described here https://github.com/erikhuda/thor/wiki/Integrating-with-Aruba-In-Process-Runs which works fine to mock HTTP requests but fails as soon as there's interaction with CLI.
Expected Behavior
I would like to find a solution to have both mocking HTTP requests and using interactive CLI Aruba features like type('something')
Your Environment
rspec 3.6.0 aruba 0.14.2 webmock 3.0.1
@christianarevalo Thanks for reporting your issue. Using interactive commands with in_process is currently not possible due to the way it's implemented. As far as I remember the reason is a deadlock due to aruba waiting for the command and the command is waiting for input (by aruba). I think we need to rebuild the inprocess feature to make this work. If you have some ideas you're welcome to propose a PR.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in a week if no further activity occurs.
This issue has been automatically closed because of inactivity. You can support the Cucumber core team on opencollective.
Aruba should definitely support this.