After a little digging in the Aruba source I figured out that the When I run
step ends up in a code block like this:
def run!(&block)
@process = ChildProcess.build(*shellwords(@cmd))
...
begin
@process.start
...
Further digging into ChildProcess
ends up here:
def launch_process
...
begin
exec(*@args)
...
And therein lies the problem. exec
does not do shell expansion when the argument list is split into multiple array elements:
If exec is given a single argument, that argument is taken as a line that is subject to shell expansion before being executed. If multiple arguments are given, the second and subsequent arguments are passed as parameters to command with no shell expansion.
However playing with shellwords
a bit we find:
Shellwords.shellwords('gem_name *.*')
=> ["gem_name", "*.*"] # No good
Shellwords.shellwords('"gem_name *.*"')
=> ["gem_name *.*"] # Aha!
Therefore the solution might be as simple as:
When I run `"gem_name *.*"`
If that doesn't work then you are pretty much out of luck. I would suggest you expand the file names manually since you're not really testing shell expansion here - we know that works: you are testing multiple arguments.
Therefore you should instead do:
When I run `gem_name your_file1 your_file2 your_file3`