scalefactory / vagrant-cucumber

A Vagrant plugin to allow cucumber to work with VMs.
MIT License
40 stars 8 forks source link

Push command execution into Glue / Support layer #4

Closed mattwynne closed 11 years ago

mattwynne commented 11 years ago

The step def for running a shell command is quite long and gnarly, and you're using instance variables (e.g. @last_shell_command_output) to pass state to the subsequent step defs.

I would push this code down into the glue layer, maybe just make a method on that module like execute_on(machine, command) and have that wrap all the detail. You can then expose last_shell_command_output as another method / attribute on the glue module.

This will keep the step defs simpler and allow you to change the implementation of the glue layer without breaking the step defs.