If one invokes a Ruby script from a cucumber step definition and that
script contains “puts” statements then where does the output go? I have
a script that when run from the command line displays “puts” output in
the terminal session, but when run from a cucumber step definition
produces no console output. It does however produce the expected output
file in either case.
James B. wrote:
If one invokes a Ruby script from a cucumber step definition and that
script contains “puts” statements then where does the output go? I have
a script that when run from the command line displays “puts” output in
the terminal session, but when run from a cucumber step definition
produces no console output. It does however produce the expected output
file in either case.
If you are running the command with the backticks it is simply being
returned to that call. If you want to see that ouput you could add a
puts… for example:
puts some_command
If you are testing a CLI tool you may want to look how Cucumber’s and
RSpec’s features capture and use the STDOUT and STDERR.
-Ben
Ben M. wrote:
If you are running the command with the backticks it is simply being
returned to that call. If you want to see that ouput you could add a
puts… for example:puts
some_command
Thanks
It produces console output for me.
Julian.