jenkins_api_client
jenkins_api_client copied to clipboard
Write tests for command line interface
I would like to extend the CLI to include the job copy command, and would develop some tests for that command. Do you have a preferred technology to use to develop command line application tests? Derek . . .
Hi @skidad I was thinking about writing tests in cucumber as it is easy and simple. The berkshelf project has great examples. If you have other options, I would be glad to know.
Cucumber looks perfect. I imagine I'll have a few questions before I am ready to submit a pull request. Thanks.
No problem, anytime.
I've got a single cucumber test written that repro's a problem that I've identified with running jenkinscli job list
: (helper.rb crashes do to lack of require 'yaml'. on Windows, Ruby 1.9 anyway) This test requires there to be a running jenkins at localhost. I'd like to not have to require a running jenkins, as is done in the spec tests, but don't understand how its done. I see the spec tests using '@client = double' to initialize the client, but can't find a definition of double. . . . I need a hint.
Correct, double
is an rspec mock object. It looks like cucumber has a way to use rspec mock objects in it. Here is more information.