I have a command line application (NON-RAILS) written in pure Ruby that I output through Cucumber and RSpec. This follows the typical hierarchy of lib, bin, spec and feature directory application hierarchies.
So far, I have been following the traditional process of writing a failed Cucumber function / script, resetting to RSpec to extract the supporting lib files, and then to transfer the script.
Unfortunately, this does not look like how to straighten the main entry point of the application in "bin / my_application.rb". The main problem for me is that I do not describe the class in RSpec, it is a serial Ruby script for managing application classes and initialization via command line parameters and parameters.
"bin / my_application.rb" is just a small shell for analyzing command line parameters and passing them to my main application class as initialization parameters. I would still like to check the behavior of the bin script (e.g. MyApp.should_receive (option_a) .with (parameter)).
Any suggestions / thoughts / tips? Is this a common test strategy for exile command line Ruby script behavior?
Thanks in advance.
source share